1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00
beestat/api/cora/exception.php
Jon Ziebell 790aaf354e Fixed #265 - Change logging from push to pull
Deceptively simple commit message. This is a massive change that completely reworks the most fundamental part of the API. Not only does it remove the push logging, it also restructures logging to give better insight into what happens during an API call.
2020-03-15 08:12:28 -04:00

31 lines
796 B
PHP

<?php
namespace cora;
/**
* Custom exception class. Requires message, code, and replaces $previous with
* $reportable to indicate if the exception should be reported to a logging
* service or not.
*
* The class name was made lowercase to simplify autoincludes, but the
* interface was otherwise left alone because I still need to support catching
* regular exceptions.
*
* @author Jon Ziebell
*/
final class exception extends \Exception {
public function __construct($message, $code, $reportable = true, $extra = null) {
$this->reportable = $reportable;
$this->extra = $extra;
return parent::__construct($message, $code, null);
}
public function getReportable() {
return $this->reportable;
}
public function getExtraInfo() {
return $this->extra;
}
}