-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathMsalException.java
More file actions
62 lines (52 loc) · 1.69 KB
/
MsalException.java
File metadata and controls
62 lines (52 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.microsoft.aad.msal4j;
/**
* Base exception type thrown when an error occurs during token acquisition.
*/
public class MsalException extends RuntimeException {
private static final long serialVersionUID = 1L;
/**
* Authentication error code
*/
private String errorCode;
/**
* Correlation ID for request tracking
*/
private String correlationId;
/**
* Initializes a new instance of the exception class
*
* @param throwable the inner exception that is the cause of the current exception
*/
public MsalException(final Throwable throwable) {
super(throwable);
}
/**
* Initializes a new instance of the exception class
*
* @param message the error message that explains the reason for the exception
*/
public MsalException(final String message, String errorCode) {
super(message);
this.errorCode = errorCode;
}
/**
* Initializes a new instance of the exception class with correlation ID
*
* @param message the error message that explains the reason for the exception
* @param errorCode the error code
* @param correlationId the correlation ID for request tracking
*/
public MsalException(final String message, String errorCode, String correlationId) {
super(LogHelper.createMessage(message, correlationId));
this.errorCode = errorCode;
this.correlationId = correlationId;
}
public String errorCode() {
return this.errorCode;
}
public String correlationId() {
return this.correlationId;
}
}