(error: {
name?: string
message?: string
data?: {
message?: string
}
})
| 161 | } |
| 162 | |
| 163 | export function formatError(error: { |
| 164 | name?: string |
| 165 | message?: string |
| 166 | data?: { |
| 167 | message?: string |
| 168 | } |
| 169 | }): string { |
| 170 | if (error.data?.message) { |
| 171 | return error.data.message |
| 172 | } |
| 173 | |
| 174 | if (error.message) { |
| 175 | return error.message |
| 176 | } |
| 177 | |
| 178 | if (error.name) { |
| 179 | return error.name |
| 180 | } |
| 181 | |
| 182 | return "unknown error" |
| 183 | } |
| 184 | |
| 185 | function isAbort(error: { name?: string } | undefined): boolean { |
| 186 | return error?.name === "MessageAbortedError" |
no outgoing calls
no test coverage detected