Closed manelj closed 6 years ago
With a try/catch or some kind of custom error handler, depends on what you want to achieve.
+1, you can do something like this:
// untested piece of code
$mapper = $spot->mapper('Entity');
try {
$mapper->update($entity);
} catch (\Spot\Exception $spotException) {
if (strpos($spotException->getMessage(), 'constraint violation') != false) {
$response = new Forbidden;
}
}
Closing this issue, because of the inactivity. Feel free to reopen this if you have more questions regarding this subject.
How can i catch and customize spot orm SQL execution integrity violations or any other sql error?