Skip to content

Commit

Permalink
better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
borispoehland committed Dec 4, 2024
1 parent 8d69914 commit 9481e7f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ export class XOXNOClient {
try {
message = JSON.parse(text)
} catch (_error) {
message = text
message = { message: text }
}

throw new Error(`${path}: ${message.message}`)
throw new Error(
`${path}: ${res.status};${res.statusText};${message.message}`
)
}

return res.json() as T
Expand Down

0 comments on commit 9481e7f

Please sign in to comment.