Versions
Look up a class, method, property or event

CHttpException

Package system.base
Inheritance class CHttpException » CException » Exception
Since 1.0
Source Code framework/base/CHttpException.php
CHttpException represents an exception caused by invalid operations of end-users.

The HTTP error code can be obtained via statusCode. Error handlers may use this status code to decide how to format the error page.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
statusCode integer HTTP status code, such as 403, 404, 500, etc. CHttpException

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
code Exception
file Exception
line Exception
message Exception

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Constructor. CHttpException
__toString() Exception
getCode() Exception
getFile() Exception
getLine() Exception
getMessage() Exception
getPrevious() Exception
getTrace() Exception
getTraceAsString() Exception

Property Details

statusCode property
public integer $statusCode;

HTTP status code, such as 403, 404, 500, etc.

Method Details

__construct() method
public void __construct(integer $status, string $message=NULL, integer $code=0)
$status integer HTTP status code, such as 404, 500, etc.
$message string error message
$code integer error code
Source Code: framework/base/CHttpException.php#34 (show)
public function __construct($status,$message=null,$code=0)
{
    
$this->statusCode=$status;
    
parent::__construct($message,$code);
}

Constructor.

Total 1 comment

#10184 report it
dimvic at 2012/10/09 09:13am
just for reference
HTTPError
    HTTPClientError
        400 - HTTPBadRequest
        401 - HTTPUnauthorized
        402 - HTTPPaymentRequired
        403 - HTTPForbidden
        404 - HTTPNotFound
        405 - HTTPMethodNotAllowed
        406 - HTTPNotAcceptable
        407 - HTTPProxyAuthenticationRequired
        408 - HTTPRequestTimeout
        409 - HTTPConfict
        410 - HTTPGone
        411 - HTTPLengthRequired
        412 - HTTPPreconditionFailed
        413 - HTTPRequestEntityTooLarge
        414 - HTTPRequestURITooLong
        415 - HTTPUnsupportedMediaType
        416 - HTTPRequestRangeNotSatisfiable
        417 - HTTPExpectationFailed
    HTTPServerError
        500 - HTTPInternalServerError
        501 - HTTPNotImplemented
        502 - HTTPBadGateway
        503 - HTTPServiceUnavailable
        504 - HTTPGatewayTimeout
        505 - HTTPVersionNotSupported

Leave a comment

Please to leave your comment.