
com.chain.sequence.exception.JSONException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sequence-sdk Show documentation
Show all versions of sequence-sdk Show documentation
The Official Java SDK for Chain Core Developer Edition
The newest version!
package com.chain.sequence.exception;
/**
* JSONException is thrown when a response from the API cannot be deserialized
* from JSON.
*/
public class JSONException extends ChainException {
/**
* Unique indentifier of the request to the server.
*/
public String requestId;
/**
* Default constructor.
*/
public JSONException(String message) {
super(message);
}
/**
* Initializes exception with its message and requestId attributes.
* Use this constructor in context of an API call.
*
* @param message error message
* @param requestId unique identifier of the request
*/
public JSONException(String message, String requestId) {
super(message);
this.requestId = requestId;
}
public String getMessage() {
String message = "Message: " + super.getMessage();
if (requestId != null) {
message += " Request-ID: " + requestId;
}
return message;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy