Skip to content

Commit 177dc66

Browse files
committed
Add suberror for network errors
1 parent f1eb2d8 commit 177dc66

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ MSAL Wiki : https://github.com/AzureAD/microsoft-authentication-library-for-andr
22

33
vNext
44
----------
5+
-[MINOR] Add suberror for network errors (#2218)
56
-[MINOR] Migrate Base64 away from Msebera (#2210)
67

78
Version 5.7.0

common

Submodule common updated 52 files

msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ private MsalException baseExceptionToMsalException(@NonNull final BaseException
16471647
);
16481648
}
16491649

1650-
return new MsalClientException(exception.getErrorCode(), exception.getMessage());
1650+
return MsalExceptionAdapter.msalExceptionFromBaseException(exception);
16511651
}
16521652

16531653
/**

msal/src/main/java/com/microsoft/identity/client/internal/controllers/MsalExceptionAdapter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
public class MsalExceptionAdapter {
4343

4444
public static MsalException msalExceptionFromBaseException(final BaseException e) {
45+
final MsalException result = msalExceptionFromBaseExceptionInternal(e);
46+
result.setSubErrorCode(e.getSubErrorCode());
47+
return result;
48+
}
49+
50+
private static MsalException msalExceptionFromBaseExceptionInternal(final BaseException e) {
4551
if (e instanceof MsalException) {
4652
return (MsalException) e;
4753
}
@@ -69,7 +75,7 @@ public static MsalException msalExceptionFromBaseException(final BaseException e
6975
final UiRequiredException uiRequiredException = ((UiRequiredException) e);
7076
return new MsalUiRequiredException(
7177
uiRequiredException.getErrorCode(),
72-
uiRequiredException.getOAuthSubErrorCode(),
78+
uiRequiredException.getSubErrorCode(),
7379
uiRequiredException.getMessage()
7480
);
7581
}

0 commit comments

Comments
 (0)