@@ -96,7 +96,7 @@ public void prefetchConfiguration(
96
96
isPrefetched = true ;
97
97
fetchConfigurationLatch .countDown ();
98
98
} catch (Exception e ) {
99
- promise .reject ("RNAppAuth Error " , "Failed to convert serviceConfiguration" , e );
99
+ promise .reject ("configuration_error " , "Failed to convert serviceConfiguration" , e );
100
100
}
101
101
} else if (mServiceConfiguration .get () == null ) {
102
102
final Uri issuerUri = Uri .parse (issuer );
@@ -107,7 +107,7 @@ public void onFetchConfigurationCompleted(
107
107
@ Nullable AuthorizationServiceConfiguration fetchedConfiguration ,
108
108
@ Nullable AuthorizationException ex ) {
109
109
if (ex != null ) {
110
- promise .reject ("RNAppAuth Error " , "Failed to fetch configuration" , ex );
110
+ promise .reject ("service_configuration_fetch_error " , "Failed to fetch configuration" , ex );
111
111
return ;
112
112
}
113
113
mServiceConfiguration .set (fetchedConfiguration );
@@ -126,7 +126,7 @@ public void onFetchConfigurationCompleted(
126
126
fetchConfigurationLatch .await ();
127
127
promise .resolve (isPrefetched );
128
128
} catch (Exception e ) {
129
- promise .reject ("RNAppAuth Error " , "Failed to await fetch configuration" , e );
129
+ promise .reject ("service_configuration_fetch_error " , "Failed to await fetch configuration" , e );
130
130
}
131
131
}
132
132
@@ -175,7 +175,7 @@ public void authorize(
175
175
additionalParametersMap
176
176
);
177
177
} catch (Exception e ) {
178
- promise .reject ("Failed to authenticate " , e .getMessage ());
178
+ promise .reject ("authentication_failed " , e .getMessage ());
179
179
}
180
180
} else {
181
181
final Uri issuerUri = Uri .parse (issuer );
@@ -186,7 +186,7 @@ public void onFetchConfigurationCompleted(
186
186
@ Nullable AuthorizationServiceConfiguration fetchedConfiguration ,
187
187
@ Nullable AuthorizationException ex ) {
188
188
if (ex != null ) {
189
- promise .reject ("Failed to fetch configuration " , getErrorMessage (ex ));
189
+ promise .reject ("service_configuration_fetch_error " , getErrorMessage (ex ));
190
190
return ;
191
191
}
192
192
@@ -257,7 +257,7 @@ public void refresh(
257
257
promise
258
258
);
259
259
} catch (Exception e ) {
260
- promise .reject ("Failed to refresh token " , e .getMessage ());
260
+ promise .reject ("token_refresh_failed " , e .getMessage ());
261
261
}
262
262
} else {
263
263
final Uri issuerUri = Uri .parse (issuer );
@@ -268,7 +268,7 @@ public void onFetchConfigurationCompleted(
268
268
@ Nullable AuthorizationServiceConfiguration fetchedConfiguration ,
269
269
@ Nullable AuthorizationException ex ) {
270
270
if (ex != null ) {
271
- promise .reject ("Failed to fetch configuration " , getErrorMessage (ex ));
271
+ promise .reject ("service_configuration_fetch_error " , getErrorMessage (ex ));
272
272
return ;
273
273
}
274
274
@@ -301,7 +301,7 @@ public void onActivityResult(Activity activity, int requestCode, int resultCode,
301
301
if (requestCode == 0 ) {
302
302
if (data == null ) {
303
303
if (promise != null ) {
304
- promise .reject ("Failed to authenticate " , "Data intent is null" );
304
+ promise .reject ("authentication_error " , "Data intent is null" );
305
305
}
306
306
return ;
307
307
}
@@ -310,7 +310,7 @@ public void onActivityResult(Activity activity, int requestCode, int resultCode,
310
310
AuthorizationException exception = AuthorizationException .fromIntent (data );
311
311
if (exception != null ) {
312
312
if (promise != null ) {
313
- promise .reject ("Failed to authenticate " , getErrorMessage (exception ));
313
+ promise .reject ("authentication_error " , getErrorMessage (exception ));
314
314
}
315
315
return ;
316
316
}
@@ -336,7 +336,7 @@ public void onTokenRequestCompleted(
336
336
}
337
337
} else {
338
338
if (promise != null ) {
339
- promise .reject ("Failed exchange token " , getErrorMessage (ex ));
339
+ promise .reject ("token_exchange_failed " , getErrorMessage (ex ));
340
340
}
341
341
}
342
342
}
@@ -476,7 +476,7 @@ public void onTokenRequestCompleted(@Nullable TokenResponse response, @Nullable
476
476
WritableMap map = TokenResponseFactory .tokenResponseToMap (response );
477
477
promise .resolve (map );
478
478
} else {
479
- promise .reject ("Failed to refresh token " , getErrorMessage (ex ));
479
+ promise .reject ("token_refresh_failed " , getErrorMessage (ex ));
480
480
}
481
481
}
482
482
};
0 commit comments