---
source: apollo-errors/crates/apollo-errors-derive/src/tests.rs
expression: pretty_print(output)
---
#[automatically_derived]
impl ::std::fmt::Display for ErrorWithHttpStatus {
    fn fmt(
        &self,
        __apollo_formatter: &mut ::std::fmt::Formatter<'_>,
    ) -> ::std::fmt::Result {
        match self {
            Self::NotFound => write!(__apollo_formatter, "Resource not found"),
            Self::Unauthorized => write!(__apollo_formatter, "Unauthorized access"),
            Self::InternalError => write!(__apollo_formatter, "Internal server error"),
        }
    }
}
#[automatically_derived]
impl ::std::error::Error for ErrorWithHttpStatus {
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
        match self {
            Self::NotFound => ::std::option::Option::None,
            Self::Unauthorized => ::std::option::Option::None,
            Self::InternalError => ::std::option::Option::None,
        }
    }
}
#[automatically_derived]
impl ::apollo_errors::Error for ErrorWithHttpStatus {
    fn to_json(
        &self,
        config: ::apollo_errors::private::FormatConfig,
    ) -> ::std::result::Result<
        ::apollo_errors::private::serde_json::Value,
        ::apollo_errors::private::serde_json::Error,
    > {
        match self {
            Self::NotFound => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "resource::not_found",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "RESOURCE_NOT_FOUND"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "resourceNotFound",
                    ::apollo_errors::private::CodeCase::PascalCase => "ResourceNotFound",
                    ::apollo_errors::private::CodeCase::KebabCase => "resource-not-found",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                ::std::result::Result::Ok(
                    ::apollo_errors::private::serde_json::json!(
                        { "error" : __apollo_code, "message" : __apollo_message }
                    ),
                )
            }
            Self::Unauthorized => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "auth::unauthorized",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "AUTH_UNAUTHORIZED"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "authUnauthorized",
                    ::apollo_errors::private::CodeCase::PascalCase => "AuthUnauthorized",
                    ::apollo_errors::private::CodeCase::KebabCase => "auth-unauthorized",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                ::std::result::Result::Ok(
                    ::apollo_errors::private::serde_json::json!(
                        { "error" : __apollo_code, "message" : __apollo_message }
                    ),
                )
            }
            Self::InternalError => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "server::internal",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "SERVER_INTERNAL"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "serverInternal",
                    ::apollo_errors::private::CodeCase::PascalCase => "ServerInternal",
                    ::apollo_errors::private::CodeCase::KebabCase => "server-internal",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                ::std::result::Result::Ok(
                    ::apollo_errors::private::serde_json::json!(
                        { "error" : __apollo_code, "message" : __apollo_message }
                    ),
                )
            }
        }
    }
    fn to_html(
        &self,
        config: ::apollo_errors::private::FormatConfig,
    ) -> ::std::string::String {
        match self {
            Self::NotFound => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "resource::not_found",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "RESOURCE_NOT_FOUND"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "resourceNotFound",
                    ::apollo_errors::private::CodeCase::PascalCase => "ResourceNotFound",
                    ::apollo_errors::private::CodeCase::KebabCase => "resource-not-found",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                let __apollo_help_html = ::apollo_errors::private::diagnostic_help(self)
                    .map(|h| {
                        format!(
                            "<p class=\"error-help\">{}</p>",
                            ::apollo_errors::private::HtmlEscaped(h)
                        )
                    })
                    .unwrap_or_default();
                let __apollo_extensions_html = ::std::string::String::new();
                format!(
                    "<div class=\"error\">\n<h3 class=\"error-code\">{}</h3>\n<p class=\"error-message\">{}</p>\n{}{}\n</div>",
                    ::apollo_errors::private::HtmlEscaped(__apollo_code),
                    ::apollo_errors::private::HtmlEscaped(& __apollo_message),
                    __apollo_help_html, __apollo_extensions_html
                )
            }
            Self::Unauthorized => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "auth::unauthorized",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "AUTH_UNAUTHORIZED"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "authUnauthorized",
                    ::apollo_errors::private::CodeCase::PascalCase => "AuthUnauthorized",
                    ::apollo_errors::private::CodeCase::KebabCase => "auth-unauthorized",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                let __apollo_help_html = ::apollo_errors::private::diagnostic_help(self)
                    .map(|h| {
                        format!(
                            "<p class=\"error-help\">{}</p>",
                            ::apollo_errors::private::HtmlEscaped(h)
                        )
                    })
                    .unwrap_or_default();
                let __apollo_extensions_html = ::std::string::String::new();
                format!(
                    "<div class=\"error\">\n<h3 class=\"error-code\">{}</h3>\n<p class=\"error-message\">{}</p>\n{}{}\n</div>",
                    ::apollo_errors::private::HtmlEscaped(__apollo_code),
                    ::apollo_errors::private::HtmlEscaped(& __apollo_message),
                    __apollo_help_html, __apollo_extensions_html
                )
            }
            Self::InternalError => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "server::internal",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "SERVER_INTERNAL"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "serverInternal",
                    ::apollo_errors::private::CodeCase::PascalCase => "ServerInternal",
                    ::apollo_errors::private::CodeCase::KebabCase => "server-internal",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                let __apollo_help_html = ::apollo_errors::private::diagnostic_help(self)
                    .map(|h| {
                        format!(
                            "<p class=\"error-help\">{}</p>",
                            ::apollo_errors::private::HtmlEscaped(h)
                        )
                    })
                    .unwrap_or_default();
                let __apollo_extensions_html = ::std::string::String::new();
                format!(
                    "<div class=\"error\">\n<h3 class=\"error-code\">{}</h3>\n<p class=\"error-message\">{}</p>\n{}{}\n</div>",
                    ::apollo_errors::private::HtmlEscaped(__apollo_code),
                    ::apollo_errors::private::HtmlEscaped(& __apollo_message),
                    __apollo_help_html, __apollo_extensions_html
                )
            }
        }
    }
    fn to_graphql(
        &self,
        config: ::apollo_errors::private::FormatConfig,
    ) -> ::std::result::Result<
        ::apollo_errors::private::serde_json::Value,
        ::apollo_errors::private::serde_json::Error,
    > {
        match self {
            Self::NotFound => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "resource::not_found",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "RESOURCE_NOT_FOUND"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "resourceNotFound",
                    ::apollo_errors::private::CodeCase::PascalCase => "ResourceNotFound",
                    ::apollo_errors::private::CodeCase::KebabCase => "resource-not-found",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                ::std::result::Result::Ok(
                    ::apollo_errors::private::serde_json::json!(
                        { "message" : __apollo_message, "extensions" : { "code" :
                        __apollo_code } }
                    ),
                )
            }
            Self::Unauthorized => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "auth::unauthorized",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "AUTH_UNAUTHORIZED"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "authUnauthorized",
                    ::apollo_errors::private::CodeCase::PascalCase => "AuthUnauthorized",
                    ::apollo_errors::private::CodeCase::KebabCase => "auth-unauthorized",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                ::std::result::Result::Ok(
                    ::apollo_errors::private::serde_json::json!(
                        { "message" : __apollo_message, "extensions" : { "code" :
                        __apollo_code } }
                    ),
                )
            }
            Self::InternalError => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "server::internal",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "SERVER_INTERNAL"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "serverInternal",
                    ::apollo_errors::private::CodeCase::PascalCase => "ServerInternal",
                    ::apollo_errors::private::CodeCase::KebabCase => "server-internal",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                ::std::result::Result::Ok(
                    ::apollo_errors::private::serde_json::json!(
                        { "message" : __apollo_message, "extensions" : { "code" :
                        __apollo_code } }
                    ),
                )
            }
        }
    }
    fn to_text(
        &self,
        config: ::apollo_errors::private::FormatConfig,
    ) -> ::std::string::String {
        match self {
            Self::NotFound => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "resource::not_found",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "RESOURCE_NOT_FOUND"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "resourceNotFound",
                    ::apollo_errors::private::CodeCase::PascalCase => "ResourceNotFound",
                    ::apollo_errors::private::CodeCase::KebabCase => "resource-not-found",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                format!("[{__apollo_code}] {__apollo_message}")
            }
            Self::Unauthorized => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "auth::unauthorized",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "AUTH_UNAUTHORIZED"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "authUnauthorized",
                    ::apollo_errors::private::CodeCase::PascalCase => "AuthUnauthorized",
                    ::apollo_errors::private::CodeCase::KebabCase => "auth-unauthorized",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                format!("[{__apollo_code}] {__apollo_message}")
            }
            Self::InternalError => {
                let __apollo_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "server::internal",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "SERVER_INTERNAL"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "serverInternal",
                    ::apollo_errors::private::CodeCase::PascalCase => "ServerInternal",
                    ::apollo_errors::private::CodeCase::KebabCase => "server-internal",
                };
                let __apollo_message = ::std::string::ToString::to_string(self);
                format!("[{__apollo_code}] {__apollo_message}")
            }
        }
    }
    fn to_jsonrpc(
        &self,
        config: ::apollo_errors::private::FormatConfig,
    ) -> ::std::result::Result<
        ::apollo_errors::private::serde_json::Value,
        ::apollo_errors::private::serde_json::Error,
    > {
        let __apollo_message = ::std::string::ToString::to_string(self);
        match self {
            Self::NotFound => {
                let __apollo_diagnostic_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "resource::not_found",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "RESOURCE_NOT_FOUND"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "resourceNotFound",
                    ::apollo_errors::private::CodeCase::PascalCase => "ResourceNotFound",
                    ::apollo_errors::private::CodeCase::KebabCase => "resource-not-found",
                };
                let mut __apollo_data = ::apollo_errors::private::serde_json::json!(
                    { "diagnostic_code" : __apollo_diagnostic_code }
                );
                if let ::apollo_errors::private::serde_json::Value::Object(
                    ref mut __apollo_map,
                ) = __apollo_data {}
                ::std::result::Result::Ok(
                    ::apollo_errors::private::serde_json::json!(
                        { "code" : - 32000i32, "message" : __apollo_message, "data" :
                        __apollo_data }
                    ),
                )
            }
            Self::Unauthorized => {
                let __apollo_diagnostic_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "auth::unauthorized",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "AUTH_UNAUTHORIZED"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "authUnauthorized",
                    ::apollo_errors::private::CodeCase::PascalCase => "AuthUnauthorized",
                    ::apollo_errors::private::CodeCase::KebabCase => "auth-unauthorized",
                };
                let mut __apollo_data = ::apollo_errors::private::serde_json::json!(
                    { "diagnostic_code" : __apollo_diagnostic_code }
                );
                if let ::apollo_errors::private::serde_json::Value::Object(
                    ref mut __apollo_map,
                ) = __apollo_data {}
                ::std::result::Result::Ok(
                    ::apollo_errors::private::serde_json::json!(
                        { "code" : - 32000i32, "message" : __apollo_message, "data" :
                        __apollo_data }
                    ),
                )
            }
            Self::InternalError => {
                let __apollo_diagnostic_code = match config.code_case {
                    ::apollo_errors::private::CodeCase::Default => "server::internal",
                    ::apollo_errors::private::CodeCase::ScreamingSnakeCase => {
                        "SERVER_INTERNAL"
                    }
                    ::apollo_errors::private::CodeCase::CamelCase => "serverInternal",
                    ::apollo_errors::private::CodeCase::PascalCase => "ServerInternal",
                    ::apollo_errors::private::CodeCase::KebabCase => "server-internal",
                };
                let mut __apollo_data = ::apollo_errors::private::serde_json::json!(
                    { "diagnostic_code" : __apollo_diagnostic_code }
                );
                if let ::apollo_errors::private::serde_json::Value::Object(
                    ref mut __apollo_map,
                ) = __apollo_data {}
                ::std::result::Result::Ok(
                    ::apollo_errors::private::serde_json::json!(
                        { "code" : - 32000i32, "message" : __apollo_message, "data" :
                        __apollo_data }
                    ),
                )
            }
        }
    }
    fn http_status(&self) -> ::apollo_errors::http::StatusCode {
        match self {
            Self::NotFound => ::apollo_errors::private::http_status_from_u16(404u16),
            Self::Unauthorized => ::apollo_errors::private::http_status_from_u16(401u16),
            Self::InternalError => ::http::StatusCode::INTERNAL_SERVER_ERROR,
        }
    }
    fn http_headers(
        &self,
    ) -> Vec<(::apollo_errors::http::HeaderName, ::apollo_errors::http::HeaderValue)> {
        match self {
            Self::NotFound => Vec::new(),
            Self::Unauthorized => Vec::new(),
            Self::InternalError => Vec::new(),
        }
    }
}
static _APOLLO_ERROR_ERRORWITHHTTPSTATUS_FIELDS_NOTFOUND: &[::apollo_errors::private::FieldMetadata] = &[];
static _APOLLO_ERROR_ERRORWITHHTTPSTATUS_FIELDS_UNAUTHORIZED: &[::apollo_errors::private::FieldMetadata] = &[];
static _APOLLO_ERROR_ERRORWITHHTTPSTATUS_FIELDS_INTERNALERROR: &[::apollo_errors::private::FieldMetadata] = &[];
static _APOLLO_ERROR_ERRORWITHHTTPSTATUS_VARIANTS: &[::apollo_errors::private::VariantMetadata] = &[
    ::apollo_errors::private::VariantMetadata::Regular(::apollo_errors::private::RegularVariantMetadata {
        name: "NotFound",
        message: "Resource not found",
        code: "resource::not_found",
        code_screaming_snake: "RESOURCE_NOT_FOUND",
        code_camel: "resourceNotFound",
        code_pascal: "ResourceNotFound",
        code_kebab: "resource-not-found",
        http_status: 404u16,
        jsonrpc_code: -32000i32,
        help: None,
        url: None,
        severity: None,
        fields: _APOLLO_ERROR_ERRORWITHHTTPSTATUS_FIELDS_NOTFOUND,
    }),
    ::apollo_errors::private::VariantMetadata::Regular(::apollo_errors::private::RegularVariantMetadata {
        name: "Unauthorized",
        message: "Unauthorized access",
        code: "auth::unauthorized",
        code_screaming_snake: "AUTH_UNAUTHORIZED",
        code_camel: "authUnauthorized",
        code_pascal: "AuthUnauthorized",
        code_kebab: "auth-unauthorized",
        http_status: 401u16,
        jsonrpc_code: -32000i32,
        help: None,
        url: None,
        severity: None,
        fields: _APOLLO_ERROR_ERRORWITHHTTPSTATUS_FIELDS_UNAUTHORIZED,
    }),
    ::apollo_errors::private::VariantMetadata::Regular(::apollo_errors::private::RegularVariantMetadata {
        name: "InternalError",
        message: "Internal server error",
        code: "server::internal",
        code_screaming_snake: "SERVER_INTERNAL",
        code_camel: "serverInternal",
        code_pascal: "ServerInternal",
        code_kebab: "server-internal",
        http_status: 500u16,
        jsonrpc_code: -32000i32,
        help: None,
        url: None,
        severity: None,
        fields: _APOLLO_ERROR_ERRORWITHHTTPSTATUS_FIELDS_INTERNALERROR,
    }),
];
static _APOLLO_ERROR_ERRORWITHHTTPSTATUS_METADATA: ::apollo_errors::private::ErrorMetadata = ::apollo_errors::private::ErrorMetadata {
    type_name: "ErrorWithHttpStatus",
    variants: _APOLLO_ERROR_ERRORWITHHTTPSTATUS_VARIANTS,
};
fn _apollo_error_errorwithhttpstatus_render_json(
    error: &(dyn std::error::Error + 'static),
    config: ::apollo_errors::private::FormatConfig,
) -> Option<
    ::std::result::Result<
        ::apollo_errors::private::serde_json::Value,
        ::apollo_errors::private::serde_json::Error,
    >,
> {
    if let Some(concrete) = error.downcast_ref::<ErrorWithHttpStatus>() {
        return Some(::apollo_errors::Error::to_json(concrete, config));
    }
    if let Some(boxed) = error.downcast_ref::<Box<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::to_json(boxed.as_ref(), config));
    }
    if let Some(arc) = error.downcast_ref::<std::sync::Arc<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::to_json(arc.as_ref(), config));
    }
    if let Some(box_arc) = error
        .downcast_ref::<Box<std::sync::Arc<ErrorWithHttpStatus>>>()
    {
        return Some(::apollo_errors::Error::to_json(box_arc.as_ref().as_ref(), config));
    }
    None
}
fn _apollo_error_errorwithhttpstatus_render_html(
    error: &(dyn std::error::Error + 'static),
    config: ::apollo_errors::private::FormatConfig,
) -> Option<String> {
    if let Some(concrete) = error.downcast_ref::<ErrorWithHttpStatus>() {
        return Some(::apollo_errors::Error::to_html(concrete, config));
    }
    if let Some(boxed) = error.downcast_ref::<Box<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::to_html(boxed.as_ref(), config));
    }
    if let Some(arc) = error.downcast_ref::<std::sync::Arc<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::to_html(arc.as_ref(), config));
    }
    if let Some(box_arc) = error
        .downcast_ref::<Box<std::sync::Arc<ErrorWithHttpStatus>>>()
    {
        return Some(::apollo_errors::Error::to_html(box_arc.as_ref().as_ref(), config));
    }
    None
}
fn _apollo_error_errorwithhttpstatus_render_graphql(
    error: &(dyn std::error::Error + 'static),
    config: ::apollo_errors::private::FormatConfig,
) -> Option<
    ::std::result::Result<
        ::apollo_errors::private::serde_json::Value,
        ::apollo_errors::private::serde_json::Error,
    >,
> {
    if let Some(concrete) = error.downcast_ref::<ErrorWithHttpStatus>() {
        return Some(::apollo_errors::Error::to_graphql(concrete, config));
    }
    if let Some(boxed) = error.downcast_ref::<Box<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::to_graphql(boxed.as_ref(), config));
    }
    if let Some(arc) = error.downcast_ref::<std::sync::Arc<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::to_graphql(arc.as_ref(), config));
    }
    if let Some(box_arc) = error
        .downcast_ref::<Box<std::sync::Arc<ErrorWithHttpStatus>>>()
    {
        return Some(
            ::apollo_errors::Error::to_graphql(box_arc.as_ref().as_ref(), config),
        );
    }
    None
}
fn _apollo_error_errorwithhttpstatus_render_text(
    error: &(dyn std::error::Error + 'static),
    config: ::apollo_errors::private::FormatConfig,
) -> Option<String> {
    if let Some(concrete) = error.downcast_ref::<ErrorWithHttpStatus>() {
        return Some(::apollo_errors::Error::to_text(concrete, config));
    }
    if let Some(boxed) = error.downcast_ref::<Box<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::to_text(boxed.as_ref(), config));
    }
    if let Some(arc) = error.downcast_ref::<std::sync::Arc<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::to_text(arc.as_ref(), config));
    }
    if let Some(box_arc) = error
        .downcast_ref::<Box<std::sync::Arc<ErrorWithHttpStatus>>>()
    {
        return Some(::apollo_errors::Error::to_text(box_arc.as_ref().as_ref(), config));
    }
    None
}
fn _apollo_error_errorwithhttpstatus_http_status(
    error: &(dyn std::error::Error + 'static),
) -> Option<::apollo_errors::http::StatusCode> {
    if let Some(concrete) = error.downcast_ref::<ErrorWithHttpStatus>() {
        return Some(::apollo_errors::Error::http_status(concrete));
    }
    if let Some(boxed) = error.downcast_ref::<Box<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::http_status(boxed.as_ref()));
    }
    if let Some(arc) = error.downcast_ref::<std::sync::Arc<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::http_status(arc.as_ref()));
    }
    if let Some(box_arc) = error
        .downcast_ref::<Box<std::sync::Arc<ErrorWithHttpStatus>>>()
    {
        return Some(::apollo_errors::Error::http_status(box_arc.as_ref().as_ref()));
    }
    None
}
fn _apollo_error_errorwithhttpstatus_render_jsonrpc(
    error: &(dyn std::error::Error + 'static),
    config: ::apollo_errors::private::FormatConfig,
) -> Option<
    ::std::result::Result<
        ::apollo_errors::private::serde_json::Value,
        ::apollo_errors::private::serde_json::Error,
    >,
> {
    if let Some(concrete) = error.downcast_ref::<ErrorWithHttpStatus>() {
        return Some(::apollo_errors::Error::to_jsonrpc(concrete, config));
    }
    if let Some(boxed) = error.downcast_ref::<Box<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::to_jsonrpc(boxed.as_ref(), config));
    }
    if let Some(arc) = error.downcast_ref::<std::sync::Arc<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::to_jsonrpc(arc.as_ref(), config));
    }
    if let Some(box_arc) = error
        .downcast_ref::<Box<std::sync::Arc<ErrorWithHttpStatus>>>()
    {
        return Some(
            ::apollo_errors::Error::to_jsonrpc(box_arc.as_ref().as_ref(), config),
        );
    }
    None
}
fn _apollo_error_errorwithhttpstatus_http_headers(
    error: &(dyn std::error::Error + 'static),
) -> Option<
    Vec<(::apollo_errors::http::HeaderName, ::apollo_errors::http::HeaderValue)>,
> {
    if let Some(concrete) = error.downcast_ref::<ErrorWithHttpStatus>() {
        return Some(::apollo_errors::Error::http_headers(concrete));
    }
    if let Some(boxed) = error.downcast_ref::<Box<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::http_headers(boxed.as_ref()));
    }
    if let Some(arc) = error.downcast_ref::<std::sync::Arc<ErrorWithHttpStatus>>() {
        return Some(::apollo_errors::Error::http_headers(arc.as_ref()));
    }
    if let Some(box_arc) = error
        .downcast_ref::<Box<std::sync::Arc<ErrorWithHttpStatus>>>()
    {
        return Some(::apollo_errors::Error::http_headers(box_arc.as_ref().as_ref()));
    }
    None
}
#[::apollo_errors::private::linkme::distributed_slice(
    ::apollo_errors::private::ERROR_REGISTRY
)]
#[linkme(crate = ::apollo_errors::private::linkme)]
#[doc(hidden)]
static _APOLLO_ERROR_ERRORWITHHTTPSTATUS_REGISTRY_ENTRY: ::apollo_errors::private::ErrorRegistryEntry = ::apollo_errors::private::ErrorRegistryEntry {
    type_id: std::any::TypeId::of::<ErrorWithHttpStatus>(),
    type_name: "ErrorWithHttpStatus",
    metadata: &_APOLLO_ERROR_ERRORWITHHTTPSTATUS_METADATA,
    render_json: _apollo_error_errorwithhttpstatus_render_json,
    render_html: _apollo_error_errorwithhttpstatus_render_html,
    render_graphql: _apollo_error_errorwithhttpstatus_render_graphql,
    render_text: _apollo_error_errorwithhttpstatus_render_text,
    http_status: _apollo_error_errorwithhttpstatus_http_status,
    render_jsonrpc: _apollo_error_errorwithhttpstatus_render_jsonrpc,
    http_headers: _apollo_error_errorwithhttpstatus_http_headers,
};
