mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-13 19:30:30 +00:00
feat(nestjs): migrate to NestJS
This commit is contained in:
19
packages/server/src/modules/Items/ServiceError.ts
Normal file
19
packages/server/src/modules/Items/ServiceError.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { HttpStatus } from '@nestjs/common';
|
||||
|
||||
export class ServiceError extends Error {
|
||||
errorType: string;
|
||||
message: string;
|
||||
payload: any;
|
||||
|
||||
constructor(errorType: string, message?: string, payload?: any) {
|
||||
super(message);
|
||||
|
||||
this.errorType = errorType;
|
||||
this.message = message || null;
|
||||
this.payload = payload;
|
||||
}
|
||||
|
||||
getStatus(): HttpStatus {
|
||||
return HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user