-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from EMCECS/bugfix-sdk-610
[SDK-610] add a new exception type to escape 4xx errors from server cooldowns
- Loading branch information
Showing
2 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
smart-client-core/src/main/java/com/emc/rest/smart/SmartClientException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.emc.rest.smart; | ||
|
||
public class SmartClientException extends RuntimeException { | ||
|
||
private ErrorType errorType = ErrorType.Unknown; | ||
|
||
public SmartClientException(String message) { | ||
super(message); | ||
} | ||
|
||
public SmartClientException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
public ErrorType getErrorType() { | ||
return errorType; | ||
} | ||
|
||
public void setErrorType(ErrorType errorType) { | ||
this.errorType = errorType; | ||
} | ||
|
||
public boolean isServerError() { | ||
return this.getErrorType().equals(SmartClientException.ErrorType.Service); | ||
} | ||
|
||
public enum ErrorType { | ||
Client, // 4xx | ||
Service, // 5xx | ||
Unknown | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters