(errorCode: ErrorCode, cause?: string)
| 39 | public statusCode: number; |
| 40 | |
| 41 | constructor(errorCode: ErrorCode, cause?: string) { |
| 42 | super(); |
| 43 | |
| 44 | const [type, surface] = errorCode.split(':'); |
| 45 | |
| 46 | this.type = type as ErrorType; |
| 47 | this.cause = cause; |
| 48 | this.surface = surface as Surface; |
| 49 | this.message = getMessageByErrorCode(errorCode); |
| 50 | this.statusCode = getStatusCodeByType(this.type); |
| 51 | } |
| 52 | |
| 53 | public toResponse() { |
| 54 | const code: ErrorCode = `${this.type}:${this.surface}`; |
nothing calls this directly
no test coverage detected