Unosquare
    Show / Hide Table of Contents

    Interface IHttpException

    Represents an exception that results in a particular HTTP response to be sent to the client.

    This interface is meant to be implemented by classes derived from .

    Either as message or a data object can be attached to the exception; which one, if any, is sent to the client will depend upon the handler used to send the response.

    Namespace: EmbedIO
    Syntax
    public interface IHttpException

    Properties

    DataObject

    Gets an object that can be serialized and included in the response triggered by a HTTP exception.

    Whether the object is actually sent to the client will depend upon the handler used to send the response.

    Declaration
    object DataObject { get; }
    Property Value
    Type Description
    Object

    Message

    Gets a message that can be included in the response triggered by a HTTP exception.

    Whether the message is actually sent to the client will depend upon the handler used to send the response.

    Declaration
    string Message { get; }
    Property Value
    Type Description
    String
    Remarks

    Do not rely on to implement this property if you want to support null messages, because a default message will be supplied by the CLR at throw time when is null.

    StackTrace

    Gets the stack trace of a HTTP exception.

    Declaration
    string StackTrace { get; }
    Property Value
    Type Description
    String

    StatusCode

    Gets the response status code for a HTTP exception.

    Declaration
    int StatusCode { get; }
    Property Value
    Type Description
    Int32

    Methods

    PrepareResponse(IHttpContext)

    Sets necessary headers, as required by the nature of the HTTP exception (e.g. Location for HttpRedirectException).

    Declaration
    void PrepareResponse(IHttpContext context)
    Parameters
    Type Name Description
    IHttpContext context

    The HTTP context of the response.

    See Also

    HttpExceptionHandlerCallback
    HttpExceptionHandler

    Comments

    Back to top Copyright © 2017-2019 Unosquare