# getmessage

Exception::getMessage

Gets the Exception message

# 

ENTITY

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

final

</div>

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

public

</div>

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

string

</div>

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

Exception::getMessage

</div>

Returns the Exception message.

# 

ENTITY ENTITY

# 

ENTITY

Returns the Exception message as a string.

# 

ENTITY

<div class="example">

<div class="title">

`Exception::getMessage` example

</div>

```
<?php
try {
    throw new Exception("Some error message");
} catch(Exception $e) {
    echo $e->getMessage();
}
?>

    
```

ENTITY

    Some error message

        

</div>

# 

ENTITY

Throwable::getMessage