diff --git a/include/ircd/m/room/auth.h b/include/ircd/m/room/auth.h index c2bc12ee2..3bcc3f781 100644 --- a/include/ircd/m/room/auth.h +++ b/include/ircd/m/room/auth.h @@ -21,6 +21,7 @@ struct ircd::m::room::auth using types = vector_view; using events_view = vector_view; using passfail = std::tuple; + IRCD_M_EXCEPTION(m::error, error, http::INTERNAL_SERVER_ERROR) IRCD_M_EXCEPTION(error, FAIL, http::UNAUTHORIZED) static bool is_power_event(const event &); diff --git a/modules/m_room_auth.cc b/modules/m_room_auth.cc index befd64222..8c30ce8ae 100644 --- a/modules/m_room_auth.cc +++ b/modules/m_room_auth.cc @@ -161,6 +161,7 @@ ircd::m::room::auth::passfail IRCD_MODULE_EXPORT ircd::m::room::auth::check(std::nothrow_t, const event &event) +try { using json::at; @@ -244,6 +245,13 @@ ircd::m::room::auth::check(std::nothrow_t, return ret; } +catch(const std::exception &) +{ + return + { + false, std::current_exception() + }; +} ircd::m::room::auth::passfail IRCD_MODULE_EXPORT