mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
upd: throw indetifiableerror instead of normal error
This commit is contained in:
parent
003c37e84c
commit
381ea14049
1 changed files with 2 additions and 1 deletions
|
@ -11,6 +11,7 @@ import { Injectable } from '@nestjs/common';
|
||||||
import type { MiMeta } from '@/models/Meta.js';
|
import type { MiMeta } from '@/models/Meta.js';
|
||||||
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
|
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class BunnyService {
|
export class BunnyService {
|
||||||
|
@ -22,7 +23,7 @@ export class BunnyService {
|
||||||
@bindThis
|
@bindThis
|
||||||
public getBunnyInfo(meta: MiMeta) {
|
public getBunnyInfo(meta: MiMeta) {
|
||||||
if (!meta.objectStorageEndpoint || !meta.objectStorageBucket || !meta.objectStorageSecretKey) {
|
if (!meta.objectStorageEndpoint || !meta.objectStorageBucket || !meta.objectStorageSecretKey) {
|
||||||
throw new Error('One of the following fields is empty: Endpoint, Bucket, Secret Key');
|
throw new IdentifiableError('689ee33f-f97c-479a-ac49-1b9f8140bf90', 'Failed to use BunnyCDN, One of the required fields is missing.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Add table
Reference in a new issue