0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

chore(core): show errors of storage provider (#5240)

This commit is contained in:
wangsijie 2024-01-30 11:09:05 +08:00 committed by GitHub
parent 2260eb01cc
commit c9117515aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,7 @@ import RequestError from '#src/errors/RequestError/index.js';
import koaGuard from '#src/middleware/koa-guard.js';
import SystemContext from '#src/tenants/SystemContext.js';
import assertThat from '#src/utils/assert-that.js';
import { consoleLog } from '#src/utils/console.js';
import { uploadFileGuard } from '#src/utils/storage/consts.js';
import { buildUploadFile } from '#src/utils/storage/index.js';
import { getTenantId } from '#src/utils/tenant.js';
@ -86,7 +87,8 @@ export default function userAssetsRoutes<T extends AuthedRouter>(...[router]: Ro
};
ctx.body = result;
} catch {
} catch (error: unknown) {
consoleLog.error(error);
throw new RequestError({
code: 'storage.upload_error',
status: 500,