File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,16 @@ class GotrueFetch {
30
30
31
31
AuthException _handleError (dynamic error) {
32
32
if (error is ! Response ) {
33
- throw AuthRetryableFetchException ();
33
+ throw AuthRetryableFetchException (message : error. toString () );
34
34
}
35
35
36
36
// If the status is 500 or above, it's likely a server error,
37
37
// and can be retried.
38
38
if (error.statusCode >= 500 ) {
39
- throw AuthRetryableFetchException ();
39
+ throw AuthRetryableFetchException (
40
+ message: error.body,
41
+ statusCode: error.statusCode.toString (),
42
+ );
40
43
}
41
44
42
45
final dynamic data;
@@ -134,7 +137,7 @@ class GotrueFetch {
134
137
}
135
138
} catch (e) {
136
139
// fetch failed, likely due to a network or CORS error
137
- throw AuthRetryableFetchException ();
140
+ throw AuthRetryableFetchException (message : e. toString () );
138
141
}
139
142
140
143
if (! isSuccessStatusCode (response.statusCode)) {
Original file line number Diff line number Diff line change @@ -31,7 +31,10 @@ class AuthSessionMissingException extends AuthException {
31
31
}
32
32
33
33
class AuthRetryableFetchException extends AuthException {
34
- AuthRetryableFetchException () : super ('AuthRetryableFetchError' );
34
+ AuthRetryableFetchException ({
35
+ String message = 'AuthRetryableFetchException' ,
36
+ super .statusCode,
37
+ }) : super (message);
35
38
}
36
39
37
40
class AuthApiException extends AuthException {
You can’t perform that action at this time.
0 commit comments