[][src]Trait async_graphql::ExtendError

pub trait ExtendError {
    fn extend(self, extensions: Value) -> Self;
fn extend_with(self, f: impl FnOnce(&Error) -> Value) -> Self; }

Extend errors with additional information.

This trait is implemented for Error and Result<T>.

Required methods

fn extend(self, extensions: Value) -> Self

Extend the error with the extensions.

The value must be a map otherwise this function will panic. It takes a value for the ergonomics of being able to use serde_json's json! macro.

If the error already contains extensions they are appended on.

fn extend_with(self, f: impl FnOnce(&Error) -> Value) -> Self

Extend the error with a callback to make the extensions.

Loading content...

Implementors

impl ExtendError for Error[src]

impl<T> ExtendError for Result<T>[src]

Loading content...