(error: Error)
| 1 | export const formatErrorMessage = (error: Error) => { |
| 2 | switch (error.message) { |
| 3 | case "invalid two-factor authentication code": |
| 4 | return "The code you entered is invalid. Please try again." |
| 5 | |
| 6 | case "invalid email or password": |
| 7 | return "The email or password you entered is invalid. Please try again." |
| 8 | |
| 9 | case "account locked, try again in a few minutes": |
| 10 | return "Your account has been locked. Please try again in a few minutes." |
| 11 | |
| 12 | case "User Already Exists": |
| 13 | return "An account with this email already exists." |
| 14 | |
| 15 | case `Unexpected token '<', "<!DOCTYPE "... is not valid JSON`: |
| 16 | case `Unexpected token '<', "<html> <"... is not valid JSON`: |
| 17 | return "An error occurred. Please try again." |
| 18 | |
| 19 | default: |
| 20 | return error.message |
| 21 | } |
| 22 | } |
no outgoing calls
no test coverage detected