0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd:Ⓜ️ Tighten exception specification for user::is_password().

This commit is contained in:
Jason Volk 2018-02-19 19:38:09 -08:00
parent 329b1dc514
commit 3d1409b243
2 changed files with 15 additions and 2 deletions

View file

@ -35,7 +35,7 @@ struct ircd::m::user
id::room::buf room_id() const; id::room::buf room_id() const;
bool is_active() const; bool is_active() const;
bool is_password(const string_view &password) const; bool is_password(const string_view &password) const noexcept;
void password(const string_view &password); void password(const string_view &password);
void activate(const json::members &contents = {}); void activate(const json::members &contents = {});

View file

@ -118,7 +118,7 @@ catch(const m::ALREADY_MEMBER &e)
bool bool
ircd::m::user::is_password(const string_view &password) ircd::m::user::is_password(const string_view &password)
const const noexcept try
{ {
char buf[64]; char buf[64];
const auto supplied const auto supplied
@ -146,6 +146,19 @@ const
return ret; return ret;
} }
catch(const m::NOT_FOUND &e)
{
return false;
}
catch(const std::exception &e)
{
log::critical
{
"user::is_password(): %s %s", string_view{user_id}, e.what()
};
return false;
}
bool bool
ircd::m::user::is_active() ircd::m::user::is_active()