write_error

Function write_error 

Source
pub async fn write_error(
    session: &mut Session,
    status: u16,
    body: &str,
    content_type: &str,
) -> Result<(), Box<Error>>
Expand description

Write an error response to a Pingora session

Convenience wrapper for error responses with status code, body, and content type.

ยงArguments

  • session - The Pingora session to write to
  • status - HTTP status code
  • body - Response body as string
  • content_type - Content-Type header value