Skip to content

Commit

Permalink
Merge branch 'develop' into ANCHOR-685-refunds
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifropc authored May 8, 2024
2 parents 6150685 + 2bbbb7b commit 655a04d
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.stellar.anchor.platform.config.RpcConfig;
import org.stellar.anchor.platform.rpc.RpcMethodHandler;
import org.stellar.anchor.platform.utils.RpcUtil;
import org.stellar.sdk.requests.ErrorResponse;

public class RpcService {

Expand Down Expand Up @@ -52,6 +53,15 @@ public List<RpcResponse> handle(List<RpcRequest> rpcRequests) {
return RpcUtil.getRpcErrorResponse(rc, ex);
} catch (BadRequestException ex) {
return RpcUtil.getRpcErrorResponse(rc, ex);
} catch (ErrorResponse ex) {
var message =
ex.getMessage() + " Code: " + ex.getCode() + " , body: " + ex.getBody();
errorEx(
String.format(
"Error response received from Horizon while processing an RPC request with method[%s] and id[%s] with message [%s]",
rc.getMethod(), rpcId, message),
ex);
return RpcUtil.getRpcErrorResponse(rc, new InternalErrorException(message));
} catch (Exception ex) {
errorEx(
String.format(
Expand Down

0 comments on commit 655a04d

Please sign in to comment.