php - Can I instantiate an exception without throwing it? -


i using saas error , exception logging service called rollbar. in code, have rollbar static object can use report exceptions service.

for example:

try {     ...     throw new someexception();     ... } catch (someexception $e) {     rollbar::report_exception($e); } 

my question is: can instantiate exception without throwing it, if other normal object, , there caveats?

i things this:

if($api_response_ok) {     // stuff     ... } else {     rollbar::report_exception(new apiexception($api_error_msg)); }  // script execution continues... 

yes, exception other object.


Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -