Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve query error handling #108

Merged
merged 11 commits into from
Aug 23, 2022
Merged

Conversation

matthiasmatt
Copy link
Collaborator

@matthiasmatt matthiasmatt commented Aug 23, 2022

  • Improve query error logging and output
  • fix issues with multi message transactiojn

Currently, when a query fail we only have the grpc error:

grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.UNKNOWN
        details = "All input prices are expired"
        debug_error_string = "UNKNOWN:Error received from peer ipv4:34.130.250.6:9090 {created_time:"2022-08-23T11:59:40.26568-03:00", grpc_status:2, grpc_message:"All input prices are expired"}"
>

With this change, we now have:

Traceback (most recent call last):
  File "/Users/mdarblade/code/py-sdk/test.py", line 23, in <module>
    validator.query.pricefeed.price("ubtc:unusd")
  File "/Users/mdarblade/code/py-sdk/nibiru/query_clients/pricefeed.py", line 24, in price
    return self.query(self.api.QueryPrice, req)
  File "/Users/mdarblade/code/py-sdk/nibiru/query_clients/util.py", line 140, in query
    raise QueryError(
nibiru.exceptions.QueryError: Error on QueryPrice: All input prices are expired

fix #106

@matthiasmatt matthiasmatt marked this pull request as draft August 23, 2022 15:10
@matthiasmatt matthiasmatt marked this pull request as ready for review August 23, 2022 15:28
tests/utils_test.py Outdated Show resolved Hide resolved
nibiru/transaction.py Outdated Show resolved Hide resolved
@Unique-Divine Unique-Divine enabled auto-merge (squash) August 23, 2022 19:42
@Unique-Divine Unique-Divine merged commit e177308 into master Aug 23, 2022
@Unique-Divine Unique-Divine deleted the mat/improve_query_error_handling branch August 23, 2022 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Sending Tx with more than one message fails
2 participants