diff --git a/primitives/api/src/lib.rs b/primitives/api/src/lib.rs index 91d4b07a1cefc..dcc70cbb44887 100644 --- a/primitives/api/src/lib.rs +++ b/primitives/api/src/lib.rs @@ -519,6 +519,8 @@ pub enum ApiError { StateBackendIsNotTrie, #[error(transparent)] Application(#[from] Box), + #[error("Api called for an unknownBlock: {0}")] + UnknownBlock(String), } /// Extends the runtime api implementation with some common functionality. diff --git a/primitives/blockchain/src/error.rs b/primitives/blockchain/src/error.rs index c82fb9bebf4ee..22ad24790df1e 100644 --- a/primitives/blockchain/src/error.rs +++ b/primitives/blockchain/src/error.rs @@ -188,6 +188,7 @@ impl From> for Error { impl From for ApiError { fn from(err: Error) -> ApiError { match err { + Error::UnknownBlock(msg) => ApiError::UnknownBlock(msg), Error::RuntimeApiError(err) => err, e => ApiError::Application(Box::new(e)), }