mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
ircd::ctx: Improve exception handling at base frame.
This commit is contained in:
parent
cbf456a388
commit
1a53b0e6e4
1 changed files with 11 additions and 10 deletions
21
ircd/ctx.cc
21
ircd/ctx.cc
|
@ -109,11 +109,11 @@ noexcept try
|
||||||
}
|
}
|
||||||
catch(const ircd::ctx::interrupted &)
|
catch(const ircd::ctx::interrupted &)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
catch(const ircd::ctx::terminated &)
|
catch(const ircd::ctx::terminated &)
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
catch(const std::exception &e)
|
catch(const std::exception &e)
|
||||||
{
|
{
|
||||||
|
@ -124,14 +124,15 @@ catch(const std::exception &e)
|
||||||
id,
|
id,
|
||||||
e.what()
|
e.what()
|
||||||
};
|
};
|
||||||
|
}
|
||||||
// Preserving the stacktrace from the throw point here is hopeless.
|
catch(...)
|
||||||
// We can terminate for developer nuisance but we will never know
|
{
|
||||||
// where this exception came from and where it is going. Bottom line
|
log::critical
|
||||||
// is that #ifdef'ing away this handler or rethrowing isn't as useful as
|
{
|
||||||
// handling the exception here with a log message and calling it a day.
|
"ctx('%s' id:%u): unexpected",
|
||||||
assert(0);
|
name,
|
||||||
return;
|
id
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Direct context switch to this context.
|
/// Direct context switch to this context.
|
||||||
|
|
Loading…
Reference in a new issue