(status: number)
| 25 | } |
| 26 | |
| 27 | function formatHttpStatus(status: number): string { |
| 28 | switch (status) { |
| 29 | case 401: |
| 30 | return "Authentication failed. Please check your Xero credentials."; |
| 31 | case 403: |
| 32 | return "You don't have permission to access this resource in Xero."; |
| 33 | case 404: |
| 34 | return "The requested resource was not found in Xero."; |
| 35 | case 429: |
| 36 | return "Too many requests to Xero. Please try again in a moment."; |
| 37 | default: |
| 38 | return ""; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Format error messages for return to the LLM. |