sytle
This commit is contained in:
parent
191c5f07a4
commit
6feda8469a
|
|
@ -752,12 +752,12 @@ export class DriveService {
|
|||
return;
|
||||
} else {
|
||||
const error = new Error(`Failed to delete the file from the object storage with the given key: ${key}`);
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
Object.defineProperty(error, 'stack', { value: ''});
|
||||
Object.defineProperty(err, 'stack', { value: ''});
|
||||
}
|
||||
error['cause'] = err;
|
||||
throw error;
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
Object.defineProperty(error, 'stack', { value: '' });
|
||||
Object.defineProperty(err, 'stack', { value: '' });
|
||||
}
|
||||
error['cause'] = err;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
const err = new Error('Duplicated note');
|
||||
err.name = 'duplicated';
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
Object.defineProperty(err, 'stack', { value: ''});
|
||||
Object.defineProperty(err, 'stack', { value: '' });
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,26 +83,26 @@ export class ApNoteService {
|
|||
if (!validPost.includes(getApType(object))) {
|
||||
const error = new Error(`invalid Note: invalid object type ${getApType(object)}`);
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
Object.defineProperty(error, 'stack', { value: ''});
|
||||
Object.defineProperty(error, 'stack', { value: '' });
|
||||
}
|
||||
return error
|
||||
return error;
|
||||
}
|
||||
|
||||
if (object.id && this.utilityService.extractDbHost(object.id) !== expectHost) {
|
||||
const error = new Error(`invalid Note: id has different host. expected: ${expectHost}, actual: ${this.utilityService.extractDbHost(object.id)}`);
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
Object.defineProperty(error, 'stack', { value: ''});
|
||||
Object.defineProperty(error, 'stack', { value: '' });
|
||||
}
|
||||
return error
|
||||
return error;
|
||||
}
|
||||
|
||||
const actualHost = object.attributedTo && this.utilityService.extractDbHost(getOneApId(object.attributedTo));
|
||||
if (object.attributedTo && actualHost !== expectHost) {
|
||||
const error = new Error(`invalid Note: attributedTo has different host. expected: ${expectHost}, actual: ${actualHost}`);
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
Object.defineProperty(error, 'stack', { value: ''});
|
||||
Object.defineProperty(error, 'stack', { value: '' });
|
||||
}
|
||||
return error
|
||||
return error;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@ export function ErrorHandling(message: string): Error {
|
|||
error.stack = undefined;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@ export function ErrorHandling(message: string): Error {
|
|||
error.stack = undefined;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue