catch all exceptions so that we have logs

This commit is contained in:
Gilles Crettenand
2015-05-21 14:33:25 +02:00
parent eed4a1ef9c
commit 3406e640e9

View File

@@ -58,6 +58,9 @@ abstract class WebService
$data["error"]["name"] = $e->getName(); $data["error"]["name"] = $e->getName();
$data["error"]["reason"] = $e->getMessage(); $data["error"]["reason"] = $e->getMessage();
$this->log(sprintf("Failure : [%s] %s", $e->getCode(), $e->getName())); $this->log(sprintf("Failure : [%s] %s", $e->getCode(), $e->getName()));
} catch (Exception $e) {
$data["unexpected error"]["message"] = $e->getMessage();
$this->log(sprintf("Unexpected exception : %s", $e->getMessage()));
} }
$this->Send($data); $this->Send($data);