(response: SuccessType<T> | ErrorType)
| 6 | |
| 7 | // Used client-side to report generic errors |
| 8 | export function maybeReportError<T>(response: SuccessType<T> | ErrorType): response is ErrorType { |
| 9 | if (response.status === "error") { |
| 10 | toast({ |
| 11 | description: response.message, |
| 12 | status: "error", |
| 13 | duration: 5000, |
| 14 | isClosable: true, |
| 15 | }); |
| 16 | return true; |
| 17 | } |
| 18 | |
| 19 | return false; |
| 20 | } |
no outgoing calls
no test coverage detected