HEX
Server: LiteSpeed
System: Linux server334.web-hosting.com 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User: richfield (1256)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: /home/richfield/app.richfield-egy.com/plugins/enigma/lib/enigma_error.php
<?php

/**
 +-------------------------------------------------------------------------+
 | Error class for the Enigma Plugin                                       |
 |                                                                         |
 | Copyright (C) The Roundcube Dev Team                                    |
 |                                                                         |
 | Licensed under the GNU General Public License version 3 or              |
 | any later version with exceptions for skins & plugins.                  |
 | See the README file for a full license statement.                       |
 +-------------------------------------------------------------------------+
 | Author: Aleksander Machniak <alec@alec.pl>                              |
 +-------------------------------------------------------------------------+
*/

class enigma_error
{
    private $code;
    private $message;
    private $data = [];

    // error codes
    const OK          = 0;
    const INTERNAL    = 1;
    const NODATA      = 2;
    const KEYNOTFOUND = 3;
    const DELKEY      = 4;
    const BADPASS     = 5;
    const EXPIRED     = 6;
    const UNVERIFIED  = 7;
    const NOMDC       = 8;


    function __construct($code = null, $message = '', $data = [])
    {
        $this->code    = $code;
        $this->message = $message;
        $this->data    = $data;
    }

    function getCode()
    {
        return $this->code;
    }

    function getMessage()
    {
        return $this->message;
    }

    function getData($name = null)
    {
        if ($name) {
            return $this->data[$name] ?? null;
        }

        return $this->data;
    }
}