Predefined Exceptions Flashcards
What is Exception?
Exception is the base class for all exceptions.
What are the following exception properties?
message
code
file
line
message - the exception message.
code - the exception code.
file - the filename where the exception was created.
line - the line where the exception was created.
What are the parameters for Exception::__construct()?
string $message = ‘’ //the Exception message to throw
int $code = 0 //the Exception code
Exception $previous = NULL //the previous exception, used for the exception chaining
What does Exception::getTrace() return?
The Exception stack trace.
What does Exception::getTraceAsString() return?
The Exception stack trace as a string.
Are Exceptions clonable?
No.
What property doe ErrorException add to Exception?
int $severity - the severity of the Exception.
What are the parameters for ErrorException::__construct()?
message - the Exception message to throw
code - the Exception code
severity - the severity level of the Exception
filename - the filename where the Exception is thrown.
lineno - the linenumber where the Exception is thrown.
previous - the previous exception used for the exception chaining.
What does ErrorException::__getSeverity() return?
The severity of the exception.