MphpD
v1.2.4 Documentation GitHub

# MPDException

MPDException is a slightly modified version of a standard Exception. You may call `MPDException::getCode` and `MPDException::getMessage` to retrieve information about the error.

In case an error occurs at the protocol level the called methods simply return false.

To retrieve the last occurred error call MphpD::get_last_error.

    MphpD::get_last_error() : array

## Methods

### __construct

    MPDException::__construct( $message = '',  $code = 0, ?Throwable $previous = null, string $command = '', int $commandlist_num = 0) : mixed

#### Parameters

None.

#### Returns `mixed`

### __toString

Returns all information as string

    MPDException::__toString() : string

#### Parameters

None.

#### Returns `string`

string

### getCommand

Returns the command which caused the error.

    MPDException::getCommand() : string

#### Parameters

None.

#### Returns `string`

string

### getCommandlistNum

Returns the command's list-number in case a commandlist was used.

    MPDException::getCommandlistNum() : int

#### Parameters

None.

#### Returns `int`

int

### __wakeup

    MPDException::__wakeup() : mixed

#### Parameters

None.

#### Returns `mixed`

### getMessage

    MPDException::getMessage() : string

#### Parameters

None.

#### Returns `string`

### getCode

    MPDException::getCode() : mixed

#### Parameters

None.

#### Returns `mixed`

### getFile

    MPDException::getFile() : string

#### Parameters

None.

#### Returns `string`

### getLine

    MPDException::getLine() : int

#### Parameters

None.

#### Returns `int`

### getTrace

    MPDException::getTrace() : array

#### Parameters

None.

#### Returns `array`

### getPrevious

    MPDException::getPrevious() : Throwable

#### Parameters

None.

#### Returns `Throwable`

### getTraceAsString

    MPDException::getTraceAsString() : string

#### Parameters

None.

#### Returns `string`

© 2023 Florian Faber