# construct

Exception::\_\_construct

Construct the exception

# 

ENTITY

<div data-wrapper="1" role="Exception">

public

</div>

<div data-wrapper="1" role="Exception">

Exception::\_\_construct

</div>

<div data-wrapper="1" role="Exception">

string

</div>

<div data-wrapper="1" role="Exception">

message

</div>

<div data-wrapper="1" role="Exception">

""

</div>

<div data-wrapper="1" role="Exception">

int

</div>

<div data-wrapper="1" role="Exception">

code

</div>

<div data-wrapper="1" role="Exception">

0

</div>

<div data-wrapper="1" role="Exception">

Throwable

</div>

<div data-wrapper="1" role="Exception">

null

</div>

<div data-wrapper="1" role="Exception">

previous

</div>

<div data-wrapper="1" role="Exception">

ENTITY

</div>

Constructs the Exception.

# 

ENTITY

`message`  
The Exception message to throw.

`code`  
The Exception code.

`previous`  
The previous exception used for the exception chaining.

> [!NOTE]
> Calling the constructor of class Exception from a subclass ignores the default arguments, if the properties \$code and \$message are already set.

# 

ENTITY

> [!NOTE]
> The `message` is *NOT* binary safe.