0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 08:12:37 +01:00

ircd: Add plain string terminate.

This commit is contained in:
Jason Volk 2019-06-23 06:59:05 -06:00
parent 82a7d736d1
commit 2e7f272570
3 changed files with 31 additions and 5 deletions

View file

@ -116,6 +116,7 @@ struct ircd::terminate
{
[[noreturn]] terminate(const std::exception &) noexcept;
[[noreturn]] terminate(std::exception_ptr) noexcept;
[[noreturn]] terminate(const string_view &) noexcept;
[[noreturn]] terminate() noexcept;
};

View file

@ -2592,7 +2592,10 @@ __attribute__((noreturn))
ircd::db::database::stats::passthru::Reset()
noexcept
{
throw panic {"Unavailable for passthru"};
ircd::terminate
{
"Unavailable for passthru"
};
}
void
@ -2629,7 +2632,10 @@ __attribute__((noreturn))
ircd::db::database::stats::passthru::getTickerCount(const uint32_t tickerType)
const noexcept
{
throw panic {"Unavailable for passthru"};
ircd::terminate
{
"Unavailable for passthru"
};
}
void
@ -2638,7 +2644,10 @@ ircd::db::database::stats::passthru::setTickerCount(const uint32_t tickerType,
const uint64_t count)
noexcept
{
throw panic {"Unavailable for passthru"};
ircd::terminate
{
"Unavailable for passthru"
};
}
void
@ -2647,7 +2656,10 @@ ircd::db::database::stats::passthru::histogramData(const uint32_t type,
rocksdb::HistogramData *const data)
const noexcept
{
throw panic {"Unavailable for passthru"};
ircd::terminate
{
"Unavailable for passthru"
};
}
uint64_t
@ -2655,7 +2667,10 @@ __attribute__((noreturn))
ircd::db::database::stats::passthru::getAndResetTickerCount(const uint32_t tickerType)
noexcept
{
throw panic {"Unavailable for passthru"};
ircd::terminate
{
"Unavailable for passthru"
};
}
///////////////////////////////////////////////////////////////////////////////

View file

@ -285,6 +285,16 @@ noexcept
terminate(std::current_exception());
}
ircd::terminate::terminate(const string_view &str)
noexcept
{
static char buf[512];
strlcpy(buf, str);
fprintf(stderr, "\nIRCd Terminated :%s\n", buf);
::fflush(stderr);
std::terminate();
}
ircd::terminate::terminate(std::exception_ptr eptr)
noexcept
{