mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 08:23:56 +01:00
ircd:Ⓜ️:room: Improve error strings for room_id() resolve interface.
This commit is contained in:
parent
39e777e88f
commit
cb2b92b241
1 changed files with 27 additions and 0 deletions
|
@ -410,6 +410,7 @@ ircd::m::room_id(const mutable_buffer &out,
|
|||
ircd::m::id::room
|
||||
ircd::m::room_id(const mutable_buffer &out,
|
||||
const event::idx &event_idx)
|
||||
try
|
||||
{
|
||||
room::id ret;
|
||||
m::get(event_idx, "room_id", [&out, &ret]
|
||||
|
@ -420,10 +421,19 @@ ircd::m::room_id(const mutable_buffer &out,
|
|||
|
||||
return ret;
|
||||
}
|
||||
catch(const m::NOT_FOUND &e)
|
||||
{
|
||||
throw m::NOT_FOUND
|
||||
{
|
||||
"resolving room_id from event_idx :%s",
|
||||
e.what(),
|
||||
};
|
||||
}
|
||||
|
||||
ircd::m::id::room
|
||||
ircd::m::room_id(const mutable_buffer &out,
|
||||
const id::event &event_id)
|
||||
try
|
||||
{
|
||||
room::id ret;
|
||||
m::get(event_id, "room_id", [&out, &ret]
|
||||
|
@ -434,10 +444,19 @@ ircd::m::room_id(const mutable_buffer &out,
|
|||
|
||||
return ret;
|
||||
}
|
||||
catch(const m::NOT_FOUND &e)
|
||||
{
|
||||
throw m::NOT_FOUND
|
||||
{
|
||||
"resolving room_id from event_id :%s",
|
||||
e.what(),
|
||||
};
|
||||
}
|
||||
|
||||
ircd::m::id::room
|
||||
ircd::m::room_id(const mutable_buffer &out,
|
||||
const id::room_alias &room_alias)
|
||||
try
|
||||
{
|
||||
room::id ret;
|
||||
room::aliases::cache::get(room_alias, [&out, &ret]
|
||||
|
@ -448,6 +467,14 @@ ircd::m::room_id(const mutable_buffer &out,
|
|||
|
||||
return ret;
|
||||
}
|
||||
catch(const m::NOT_FOUND &e)
|
||||
{
|
||||
throw m::NOT_FOUND
|
||||
{
|
||||
"resolving room_id from alias :%s",
|
||||
e.what(),
|
||||
};
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::m::exists(const id::room_alias &room_alias,
|
||||
|
|
Loading…
Reference in a new issue