Predefined Exceptions Flashcards

1
Q

What is Exception?

A

Exception is the base class for all exceptions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the following exception properties?

message
code
file
line

A

message - the exception message.
code - the exception code.
file - the filename where the exception was created.
line - the line where the exception was created.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the parameters for Exception::__construct()?

A

string $message = ‘’ //the Exception message to throw
int $code = 0 //the Exception code
Exception $previous = NULL //the previous exception, used for the exception chaining

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does Exception::getTrace() return?

A

The Exception stack trace.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does Exception::getTraceAsString() return?

A

The Exception stack trace as a string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Are Exceptions clonable?

A

No.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What property doe ErrorException add to Exception?

A

int $severity - the severity of the Exception.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the parameters for ErrorException::__construct()?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does ErrorException::__getSeverity() return?

A

The severity of the exception.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly