Throw exception if domain used to call Certificates.get() does not have a certificate, fixes #722

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-10-08 18:01:59 +02:00
parent 89b95d61d2
commit b4999fcc83

View File

@@ -110,6 +110,9 @@ class Certificates extends \Froxlor\Api\ApiCommand implements \Froxlor\Api\Resou
$result = Database::pexecute_first($stmt, array(
"domainid" => $domainid
));
if (! $result) {
throw new \Exception("Domain '" . $domain['domain'] . "' does not have a certificate.", 404);
}
return $this->response(200, "successfull", $result);
}