0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::fs::opts: Add an option to suppress internal error logging on some operations.

This commit is contained in:
Jason Volk 2020-06-08 14:07:42 -07:00
parent dc1e9a3c06
commit 27d52c660b
2 changed files with 11 additions and 6 deletions

View file

@ -60,6 +60,10 @@ struct ircd::fs::opts
/// opcode and then pass the opts structure to write().
enum op op {op::NOOP};
/// Suppress logging of some expected/tolerated failures. Set to false
/// if the call should just silently rethrow.
bool errlog {true};
opts(const off_t &, const enum op & = op::NOOP);
opts() = default;
};

View file

@ -2028,12 +2028,13 @@ try
}
catch(const std::system_error &e)
{
log::derror
{
log, "`%s' :%s",
path,
e.what(),
};
if(opts.errlog)
log::derror
{
log, "`%s' :%s",
path,
e.what(),
};
throw;
}