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
Post a Comment