libzeep

PrevUpHomeNext

Class error_handler

zeep::http::error_handler — A base class for error-handler classes.

Synopsis

// In header: <zeep/http/error-handler.hpp>


class error_handler {
public:
  // construct/copy/destruct
  ( = "error.xhtml");
  (error_handler &) = ;
  error_handler & (error_handler &) = ;
  ~();

  // public member functions
   (basic_server *);
  basic_server * ();
  basic_server * () ;
   
  (request &, , reply &);
   (request &, reply &);
   (request &, , reply &);
   
  (request &, , , 
                     reply &);
};

Description

To handle errors decently when there are multiple controllers.

error_handler public construct/copy/destruct

  1. ( error_template = "error.xhtml");
    constructor

    If error_template is not empty, the error handler will try to load this XHTML template using the server's template_processor. If that fails or error_template is empty, a simple stock message is returned.

  2. (error_handler &) = ;
  3. error_handler & (error_handler &) = ;
  4. ~();

error_handler public member functions

  1.  (basic_server * s);
    set the server object we're bound to
  2. basic_server * ();
    get the server object we're bound to
  3. basic_server * () ;
    set the server object we're bound to
  4.  
    (request & req,  eptr, 
                       reply & reply);
    Create an error reply for an exception.

    This function is called by server with the captured exception.

    Parameters:

    eptr

    The captured exception, use std::rethrow_exception to use this

    reply

    Write the reply in this object

    req

    The request that triggered this call

    Returns:

    Return true if the reply was created successfully

  5.  (request & req, reply & reply);
    Create an error reply for the error containing a validation header.

    When a authentication violation is encountered, this function is called to generate the appropriate reply.

    Parameters:

    reply

    Write the reply in this object

    req

    The request that triggered this call

    Returns:

    Return true if the reply was created successfully

  6.  
    (request & req,  status, reply & reply);
    Create an error reply for the error.

    An error should be returned with HTTP status code status. This method will create a default error page.

    Parameters:

    reply

    Write the reply in this object

    req

    The request that triggered this call

    status

    The status code, describing the error

    Returns:

    Return true if the reply was created successfully

  7.  
    (request & req,  status, 
                        message, reply & reply);
    Create an error reply for the error with an additional message for the user.

    An error should be returned with HTTP status code status and additional information message. This method will create a default error page.

    Parameters:

    message

    The message describing the error

    reply

    Write the reply in this object

    req

    The request that triggered this call

    status

    The error that triggered this call

    Returns:

    Return true if the reply was created successfully


PrevUpHomeNext