(error: ArkError)
| 1098 | * supplied where it was raised, rather than written from what it expected |
| 1099 | */ |
| 1100 | export const isCustom = (error: ArkError): boolean => { |
| 1101 | if (templated.has(error)) return false |
| 1102 | if (sharing.has(error)) return true |
| 1103 | const source = ErrorSource.of(error) |
| 1104 | let config: ResolvedConfig |
| 1105 | if (source instanceof Supplied) { |
| 1106 | if (source.input.message !== undefined) return !isInvalidInput(source.input) |
| 1107 | config = source.config |
| 1108 | } else config = source |
| 1109 | return ( |
| 1110 | configuredMessageOf(error) !== undefined || |
| 1111 | configuresMessage(config, error.code) |
| 1112 | ) |
| 1113 | } |
| 1114 | |
| 1115 | // whether each config writes every code's message as the default does, found |
| 1116 | // once: nearly all do, and reading a code's writers from two configs for each |
no test coverage detected