File size: 741 Bytes
07c3cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

/**
 * HttpProxyController
 *
 * @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
 * @package gulliver.system
 * @access public
 */
class PMException extends Exception
{

    public function __construct ($message, $code = 0, $previous = null)
    {
        parent::__construct( $message, 1 );
    }

    public function __toString ()
    {
        return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
    }

    public static function registerErrorLog($error, $token){
        $ws = (!empty(config("system.workspace")))? config("system.workspace") : "Undefined Workspace";
        Bootstrap::registerMonolog('ExceptionCron', 400, $error->getMessage(), array('token'=>$token), $ws, 'processmaker.log');
    }
}