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 - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -