( code: string | undefined, fallback: AppErrorCode = 'COMMAND_FAILED', )
| 23 | export type AppErrorCode = KnownAppErrorCode | (string & {}); |
| 24 | |
| 25 | export function toAppErrorCode( |
| 26 | code: string | undefined, |
| 27 | fallback: AppErrorCode = 'COMMAND_FAILED', |
| 28 | ): AppErrorCode { |
| 29 | if (typeof code === 'string' && code.length > 0) return code; |
| 30 | return fallback; |
| 31 | } |
| 32 | |
| 33 | type AppErrorDetails = Record<string, unknown> & { |
| 34 | hint?: string; |
no outgoing calls
no test coverage detected