(cause: unknown)
| 58 | }; |
| 59 | |
| 60 | const causeMessage = (cause: unknown): string | undefined => { |
| 61 | const message = |
| 62 | cause && typeof cause === "object" |
| 63 | ? // oxlint-disable-next-line executor/no-unknown-error-message -- boundary: preserve database driver error text inside typed StorageError |
| 64 | (cause as Record<string, unknown>)["message"] |
| 65 | : undefined; |
| 66 | return typeof message === "string" && message.length > 0 ? message : undefined; |
| 67 | }; |
| 68 | |
| 69 | export const isStorageFailure = (error: unknown): error is StorageFailure => |
| 70 | Predicate.isTagged(error, "StorageError") || Predicate.isTagged(error, "UniqueViolationError"); |
no outgoing calls
no test coverage detected