Skip to content

Commit

Permalink
Update exception handling in OpenBookManager
Browse files Browse the repository at this point in the history
Expanded the catch block to handle all types of Exceptions instead of the specific RpcException. It now catches any general exception and logs the error, improving the robustness of the OpenBookManager.
  • Loading branch information
skynetcap committed Apr 30, 2024
1 parent 77084b1 commit 55bedb6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public Optional<OpenBookEventHeap> getEventHeap(PublicKey eventHeap) {
);

return Optional.of(openBookEventHeap);
} catch (RpcException e) {
} catch (Exception e) {
log.error("Error getting event heap: {}", e.getMessage(), e);
return Optional.empty();
}
Expand All @@ -180,7 +180,7 @@ public Optional<OpenBookOpenOrdersAccount> getOpenOrdersAccount(PublicKey ooa) {
);

return Optional.of(openBookOoa);
} catch (RpcException e) {
} catch (Exception e) {
log.error("Error getting OOA: {}", e.getMessage(), e);
return Optional.empty();
}
Expand Down

0 comments on commit 55bedb6

Please sign in to comment.