(status: number, message?: string, stack?: string, uid?: string)
| 53 | uid?: string; |
| 54 | |
| 55 | constructor(status: number, message?: string, stack?: string, uid?: string) { |
| 56 | super(message); |
| 57 | this.status = status ?? 500; |
| 58 | this.errorId = uuidv4(); |
| 59 | this.stack = stack; |
| 60 | this.uid = uid; |
| 61 | |
| 62 | if (isDevEnvironment()) { |
| 63 | this.message = |
| 64 | (stack ?? "") |
| 65 | ? `${String(message)}\nStack: ${String(stack)}` |
| 66 | : String(message); |
| 67 | } else { |
| 68 | if ((this.stack ?? "") && this.status >= 500) { |
| 69 | this.stack = `${this.message}\n${this.stack}`; |
| 70 | this.message = `Internal Server Error ${this.errorId}`; |
| 71 | } else { |
| 72 | this.message = String(message); |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | export default MonkeyError; |
nothing calls this directly
no test coverage detected