src/JsonRpc.php
public function setErrorHandle($err, $message, $file, $line) {
        $oJsonRpc = JsonRpc::getInstance();
        $content = explode("\n", file_get_contents($file));
        header('Content-Type: application/json');
        $id = $oJsonRpc->extractId();
        $error = array(
           "code" => 100,
           "message" => "Server error",
           "error" => array(
              "name" => "PHPErorr",
              "code" => $err,
              "message" => $message,
              "file" => $file,
              "at" => $line,
              "line" => $content[$line-1]));
        ob_end_clean();
        echo $oJsonRpc->response(null, $id, $error);
        exit();
    }
public function setErrorHandle($err, $message, $file, $line) {
        $oJsonRpc = JsonRpc::getInstance();
        $content = explode("\n", file_get_contents($file));
        header('Content-Type: application/json');
        $id = $oJsonRpc->extractId();
        $error = array(
           "code" => 100,
           "message" => "Server error",
           "error" => array(
              "name" => "PHPErorr",
              "code" => $err,
              "message" => $message,
              "file" => $file,
              "at" => $line,
              "line" => $content[$line-1]));
        ob_end_clean();
        echo $oJsonRpc->response(null, $id, $error);
        exit();
    }
public function setErrorHandle ( $ err , $ message , $ file , $ line ) { $ oJsonRpc = JsonRpc :: getInstance ( ) ; $ content = explode ( "\n" , file_get_contents ( $ file ) ) ; header ( 'Content-Type: application/json' ) ; $ id = $ oJsonRpc -> extractId ( ) ; $ error = array ( "code" => 100 , "message" => "Server error" , "error" => array ( "name" => "PHPErorr" , "code" => $ err , "message" => $ message , "file" => $ file , "at" => $ line , "line" => $ content [ $ line - 1 ] ) ) ; ob_end_clean ( ) ; echo $ oJsonRpc -> response ( null , $ id , $ error ) ; exit ( ) ; }
set error handler
@param int $err
@param string $message
@param string $file
@param string $line
set error handler