mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 04:26:58 +00:00
fix error logs and response in drive/files/create.ts
This commit is contained in:
parent
f644972760
commit
82b7768ab2
1 changed files with 2 additions and 2 deletions
|
@ -130,14 +130,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
return await this.driveFileEntityService.pack(driveFile, { self: true });
|
return await this.driveFileEntityService.pack(driveFile, { self: true });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof Error || typeof err === 'string') {
|
if (err instanceof Error || typeof err === 'string') {
|
||||||
console.error(err);
|
console.error('Error saving drive file:', err);
|
||||||
}
|
}
|
||||||
if (err instanceof IdentifiableError) {
|
if (err instanceof IdentifiableError) {
|
||||||
if (err.id === '282f77bf-5816-4f72-9264-aa14d8261a21') throw new ApiError(meta.errors.inappropriate);
|
if (err.id === '282f77bf-5816-4f72-9264-aa14d8261a21') throw new ApiError(meta.errors.inappropriate);
|
||||||
if (err.id === 'c6244ed2-a39a-4e1c-bf93-f0fbd7764fa6') throw new ApiError(meta.errors.noFreeSpace);
|
if (err.id === 'c6244ed2-a39a-4e1c-bf93-f0fbd7764fa6') throw new ApiError(meta.errors.noFreeSpace);
|
||||||
if (err.id === 'f9e4e5f3-4df4-40b5-b400-f236945f7073') throw new ApiError(meta.errors.maxFileSizeExceeded);
|
if (err.id === 'f9e4e5f3-4df4-40b5-b400-f236945f7073') throw new ApiError(meta.errors.maxFileSizeExceeded);
|
||||||
}
|
}
|
||||||
throw new ApiError();
|
throw err;
|
||||||
} finally {
|
} finally {
|
||||||
cleanup!();
|
cleanup!();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue