[auth][android] update getJSError util regex to allow extracting codes from http errors - fixes #934

This commit is contained in:
Salakar 2018-05-12 22:11:50 +01:00
parent f13a2b5f9c
commit c185b3b060
1 changed files with 1 additions and 1 deletions

View File

@ -1327,7 +1327,7 @@ class RNFirebaseAuth extends ReactContextBaseJavaModule {
error.putString("nativeErrorCode", code); error.putString("nativeErrorCode", code);
message = authException.getMessage(); message = authException.getMessage();
} catch (Exception e) { } catch (Exception e) {
Matcher matcher = Pattern.compile("\\[(.*):.*\\]").matcher(message); Matcher matcher = Pattern.compile("([A-Z]*_[A-Z]*)").matcher(message);
if (matcher.find()) { if (matcher.find()) {
code = matcher.group(1).trim(); code = matcher.group(1).trim();
switch (code) { switch (code) {