Commit Graph

3 Commits

Author SHA1 Message Date
Alexander
5fa1ebad13
Output stream like operator << for Error (#4670)
To create an error human readable message should be provided among other argmunts.
Which is good to better understanding what happend by log records.
To make it more informative user in most cases should put in those message some data (numbers, strings etc.).
This operator will help us to avoid using verbose constructions like boost::format or std::ostringstream or something similar to format a proper error message.
We will be able just to "stream" in a created error any "printable" variables from the context.

Additionaly we will be able to use "fancy" tools for streams like boost::io::quoted or std::hex to format messages.

Example:
```c++
createError(SystemErorr::NoSuchFile, "Could not read pidfile: ")
  << boost::io::quoted(pidfile_path)
  << " " << read_status.toString();
```
2018-07-05 16:12:18 +01:00
Alexander
9f69a0f8c8 Explicit use ValueType and EnumErrorType in Expected full type definition (#4650) 2018-06-28 14:46:48 +01:00
Max Kareta
c0a9e76611
osquery::Error && osquery::Expected (#4396) 2018-05-31 15:17:50 +01:00