upd: throw indetifiableerror instead of normal error

This commit is contained in:
Marie 2025-03-28 20:16:34 +01:00
parent 003c37e84c
commit 381ea14049
No known key found for this signature in database
GPG key ID: 7ADF6C9CD9A28555

View file

@ -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 {