mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 13:24:41 +03:00
Add warning about uncaught exception to AbstractProcessor
This commit is contained in:
parent
ec06357535
commit
c4a47928a8
@ -235,12 +235,20 @@ abstract class AbstractProcessor
|
||||
return $this->buildSyncResponses($this->responses);
|
||||
}
|
||||
}
|
||||
|
||||
// Output response
|
||||
} catch (\Exception $e) {
|
||||
// Something went wrong. Trigger error event
|
||||
$vars = array('exception' => $e);
|
||||
$dispatcher->triggerEvent($this->eventPrefix . 'RequestError', $vars);
|
||||
trigger_error(
|
||||
sprintf(
|
||||
'A request cannot be properly handled because of uncaught exception %s "%s" (%s:%u)',
|
||||
get_class($e),
|
||||
$e->getMessage(),
|
||||
$e->getFile(),
|
||||
$e->getLine()
|
||||
),
|
||||
E_USER_WARNING
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -319,6 +327,16 @@ abstract class AbstractProcessor
|
||||
// Trigger error event
|
||||
$vars = array('exception' => $e);
|
||||
$dispatcher->triggerEvent($this->eventPrefix . "CallError", $vars);
|
||||
trigger_error(
|
||||
sprintf(
|
||||
'Function call failed because of uncaught exception %s "%s" (%s:%u)',
|
||||
get_class($e),
|
||||
$e->getMessage(),
|
||||
$e->getFile(),
|
||||
$e->getLine()
|
||||
),
|
||||
E_USER_WARNING
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user