Add and improve custom exception types for all cases

This commit is contained in:
Dale Davies
2022-07-26 14:35:10 +01:00
parent 5b9fe67021
commit d3dc11fdf3
8 changed files with 80 additions and 21 deletions

View File

@@ -13,11 +13,13 @@
namespace Jump\API;
use \Jump\Exceptions\APIException;
class Icon extends AbstractAPI {
public function get_output(): string {
if (!isset($this->routeparams['siteurl']) || empty($this->routeparams['siteurl'])) {
throw new \Exception('The siteurl query parameter is not provided or empty');
throw new APIException('The siteurl query parameter is not provided or empty');
}
$sites = new \Jump\Sites($this->config, $this->cache);