getPipernateException must be static function for set_exception_handler