-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce the concept of recoverable errors and non recoverable errors
- Loading branch information
Showing
6 changed files
with
83 additions
and
51 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -5,4 +5,6 @@ public interface SolanaClientError | |
ErrorCode getErrorCode(); | ||
|
||
String getErrorMessage(); | ||
|
||
boolean isRecoverable(); | ||
} |
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
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
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
34 changes: 34 additions & 0 deletions
34
...src/main/java/com/lmax/solana4j/client/jsonrpc/SolanaUnrecoverableJsonRpcClientError.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,34 @@ | ||
package com.lmax.solana4j.client.jsonrpc; | ||
|
||
import com.lmax.solana4j.client.api.ErrorCode; | ||
import com.lmax.solana4j.client.api.SolanaClientError; | ||
|
||
class SolanaUnrecoverableJsonRpcClientError implements SolanaClientError | ||
{ | ||
private final ErrorCode errorCode; | ||
private final String errorMessage; | ||
|
||
SolanaUnrecoverableJsonRpcClientError(final ErrorCode errorCode, final String errorMessage) | ||
{ | ||
this.errorCode = errorCode; | ||
this.errorMessage = errorMessage; | ||
} | ||
|
||
@Override | ||
public ErrorCode getErrorCode() | ||
{ | ||
return errorCode; | ||
} | ||
|
||
@Override | ||
public String getErrorMessage() | ||
{ | ||
return errorMessage; | ||
} | ||
|
||
@Override | ||
public boolean isRecoverable() | ||
{ | ||
return false; | ||
} | ||
} |
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