enhance(logging): エラー時もっと詳しい情報が残るように (MisskeyIO#360)
This commit is contained in:
parent
bad14005f8
commit
411a8bd8e7
4 changed files with 72 additions and 11 deletions
|
|
@ -77,8 +77,20 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
// Create file
|
||||
driveFile = await this.driveService.uploadFromUrl({ url: emoji.originalUrl, user: null, force: true });
|
||||
} catch (e) {
|
||||
// TODO: need to return Drive Error
|
||||
throw new ApiError();
|
||||
const err = e as Error;
|
||||
throw new ApiError(
|
||||
{
|
||||
message: 'Failed to upload image from URL.',
|
||||
code: 'FAILED_TO_UPLOAD_IMAGE_FROM_URL',
|
||||
id: '5c77c4d7-0f68-48f9-8694-8453a2294840',
|
||||
},
|
||||
{
|
||||
e: {
|
||||
message: err.message,
|
||||
code: err.name,
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// Duplication Check
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue