-
Notifications
You must be signed in to change notification settings - Fork 156
Expand file tree
/
Copy pathMsalThrottlingException.java
More file actions
42 lines (35 loc) · 1.25 KB
/
MsalThrottlingException.java
File metadata and controls
42 lines (35 loc) · 1.25 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
package com.microsoft.aad.msal4j;
/**
* Exception type thrown when service returns throttling instruction:
* Retry-After header, 429 or 5xx statuses.
*/
public class MsalThrottlingException extends MsalServiceException {
private long retryInMs;
/**
* Constructor for MsalThrottlingException class
*
* @param retryInMs
*/
public MsalThrottlingException(long retryInMs) {
super("Request was throttled according to instructions from STS. Retry in " + retryInMs + " ms.",
AuthenticationErrorCode.THROTTLED_REQUEST);
this.retryInMs = retryInMs;
}
/**
* Constructor for MsalThrottlingException class with correlation ID
*
* @param retryInMs time to wait before retrying in milliseconds
* @param correlationId the correlation ID for request tracking
*/
public MsalThrottlingException(long retryInMs, String correlationId) {
super("Request was throttled according to instructions from STS. Retry in " + retryInMs + " ms.",
AuthenticationErrorCode.THROTTLED_REQUEST, correlationId);
this.retryInMs = retryInMs;
}
/**
* how long to wait before repeating request
*/
public long retryInMs() {
return this.retryInMs;
}
}