Commit adaa8ae
feat: surface API 401 error message with login suggestion in portal generation
Previously, running portal commands while logged out showed the generic
"An unexpected error occurred" message because the SDK's typed 401 error
(UnauthorizedResponseError) was not recognized by the axios-only
handleServiceError. Handle ApiError with status 401 in generatePortal,
extract the API's message, and pair it with a suggestion to run
`apimatic auth login` or pass `--auth-key`.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 5d50968 commit adaa8ae
2 files changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
| 77 | + | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
0 commit comments