Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Expose UnknownBlock error via ApiError #12707

Merged
merged 3 commits into from
Jan 19, 2023
Merged

Expose UnknownBlock error via ApiError #12707

merged 3 commits into from
Jan 19, 2023

Commits on Jan 10, 2023

  1. Expose UnknownBlock error via ApiError

    In [certain cases](https://github.com/paritytech/polkadot/issues/5885) a
    runtime api is called for an unknown block. For example a block which is
    already pruned or on an abandon fork.
    
    In such cases the correct error is returned but it is wrapped in
    `ApiError::Application` and the only way to figure out what is the
    problem is to inspect the actual message in the error. In polkadot for
    example this usually happens when the runtime api version is being
    queried. It's beneficial to be able to clearly separate such errors so i
    that when they occur the client side can handle them more gracefully.
    E.g. log less stressful error message than `State already discarded for
    BlockId` or cancel any pending work related on this block.
    tdimitrov committed Jan 10, 2023
    Configuration menu
    Copy the full SHA
    4b3c747 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2023

  1. Update primitives/api/src/lib.rs

    Co-authored-by: Bastian Köcher <git@kchr.de>
    tdimitrov and bkchr authored Jan 19, 2023
    Configuration menu
    Copy the full SHA
    76e4543 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    35b7576 View commit details
    Browse the repository at this point in the history