Home Server
New Blog Posts: Merging Reports - Part 1 and Part 2

Custom Error Page

edited August 2005 in Server
Hello

Is there any way to provide a custom error page to the HandleException
method of the webtier?

If not, do I need to implement the logging myself?

Cheers

Paul

Comments

  • edited August 2005

    ---------------------------------------------------
    Tech Tip: WebTier - Custom Error Page
    ---------------------------------------------------

    TrsWebErrorPage generates the default error page that is sent to a web
    browser when an exception occurs on the web tier.


    The default error page displayed by the WebTier can be replaced by creating
    a descendant of TrsWebErrorPage and then specifying the value of the
    TrsWebTier.ErrorPageClass property


    For example:

    TrsWebTier.ErrorPageClass := TmyWebErrorPage;


    To create a custom error page, descend from TrsWebErrorPage and override
    the CreateErrorPage method to generate the desired XHTML.}



    TrsWebErrorPage = class
    private
    protected
    class procedure TokenizeCharStream(aStream: String; aTokens:
    TStringList);
    class function IsExceptionToken(aToken: String): Boolean; virtual;
    class function ErrorTemplateText: String; virtual;
    class function MaxSessionErrorTemplateText: String; virtual;
    class function ProcessMessage(aMessage: String): String; virtual;

    public
    class function CreateErrorPage(aException: Exception): String;
    virtual;
    class function CreateWebLogErrorPage(aException: Exception): String;
    virtual;
    class function CreateMaxSessionErrorPage(aException: Exception):
    String; virtual;

    end;

    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.