mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd::fs::opts: Add an option to suppress internal error logging on some operations.
This commit is contained in:
parent
dc1e9a3c06
commit
27d52c660b
2 changed files with 11 additions and 6 deletions
|
@ -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;
|
||||
};
|
||||
|
|
13
ircd/fs.cc
13
ircd/fs.cc
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue