MCPcopy Index your code
hub / github.com/monkeytypegame/monkeytype / constructor

Method constructor

backend/src/utils/error.ts:55–75  ·  view source on GitHub ↗
(status: number, message?: string, stack?: string, uid?: string)

Source from the content-addressed store, hash-verified

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
78export default MonkeyError;

Callers

nothing calls this directly

Calls 1

isDevEnvironmentFunction · 0.90

Tested by

no test coverage detected