# wp-console/2.4.0/includes/Exceptions/WPConsoleException.php

WP Console – WordPress PHP Console powered by PsySH, version 2.4.0. 66 lines.

- Page: https://pluginprobe.com/plugins/wp-console/2.4.0/code/includes/Exceptions/WPConsoleException.php
- Raw: https://pluginprobe.com/plugins/wp-console/2.4.0/raw/includes/Exceptions/WPConsoleException.php
- Modified: 2023-08-09T08:23:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-console/2.4.0/code/includes/Exceptions/WPConsoleException.php#L10-L20`.

```php
<?php

namespace WPConsole\Exceptions;

use Exception;

class WPConsoleException extends Exception {

    /**
     * Error code
     *
     * @since 1.3.0
     *
     * @var string
     */
    protected $error_code = '';

    /**
     * Class constructor
     *
     * @since 1.3.0
     *
     * @param string $error_code
     * @param string $message
     * @param int    $status_code
     */
    public function __construct( $error_code, $message, $status_code = 422 ) {
        $this->error_code = $error_code;

        parent::__construct( $message, $status_code );
    }

    /**
     * Get error code
     *
     * @since 1.3.0
     *
     * @return string
     */
    final public function get_error_code() {
        return $this->error_code;
    }

    /**
     * Get error message
     *
     * @since 1.3.0
     *
     * @return string
     */
    final public function get_message() {
        return $this->getMessage();
    }

    /**
     * Get error status code
     *
     * @since 1.3.0
     *
     * @return int
     */
    final public function get_status_code() {
        return $this->getCode();
    }
}

```
