Example #1
0
 public function __construct($errcode, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null)
 {
     // make sure everything is assigned properly
     $errtxt = new ErrMsgText();
     JpGraphError::SetTitle('JpGraph Error: ' . $errcode);
     parent::__construct($errtxt->Get($errcode, $a1, $a2, $a3, $a4, $a5), 0);
 }
Example #2
0
 /**
  * Creates exception response
  * NOTE: this will not work in CLI due to JpGraph design issues
  *
  * @param \Exception $exception
  */
 public function getExceptionResponse(\Exception $exception)
 {
     if (!$exception instanceof \JpGraphException) {
         $exception = new \JpGraphException($exception->getMessage(), $exception->getCode());
     }
     ob_start();
     $exception->Stroke();
     $output = ob_get_contents();
     ob_end_clean();
     $this->response->setContent($output);
     return $this->response;
 }