Skip to content

Commit

Permalink
fix: turns out that GoTrue doesn't have a consistent error format. Ad…
Browse files Browse the repository at this point in the history
…ding another possible variation
  • Loading branch information
kiwicopple committed Oct 15, 2020
1 parent 1207790 commit 3771344
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export interface FetchOptions {
const handleError = (error: any, reject: any) => {
if (typeof error.json === 'function') {
error.json().then((msg: any) => {
let errorMessage = msg.message || msg.error_description || msg.error || JSON.stringify(msg)
let errorMessage =
msg.msg || msg.message || msg.error_description || msg.error || JSON.stringify(msg)
return reject(new Error(errorMessage))
})
} else {
Expand Down

0 comments on commit 3771344

Please sign in to comment.