Constructs an exception object with a specified error code, a format string and parameters for the formatting as specified by the Chusov::String::Printf function. .
- Template Parameters
-
char_t | is a type of the description to be set which is either char or wchar_t . |
DescriptionFormatParams | Deduced types of additional arguments passed to the function to format the message. |
- Parameters
-
[in] | nCode | is a code to be associated with the constructed exception object. |
[in] | lpszDescriptionFormat | is an optional pointer to a string specifying a format of the constructed description. See the details. |
| formatting_params | Additional parameters to be used during the construction of the description as specified for the Chusov::String::Printf <char_t> function. If lpszDescriptionFormat is NULL the additional parameters are ignored. |
The constructor creates an instance of the ExceptionWithGenericCode<code_t>
class with associated error code and the description. The description is constructed as specified by the format string using control character sequences, as specified for the Chusov::String::Printf <char_t> function. The result of this formatting is analyzed for presence of the <CODE> and <DESCRIPTION> tags which are replaced by a string representation of an error code and by the corresponding description respectively. Because the latter is not specified, the corresponding description states that fact. To specify a function objects which maps the error code use the ExceptionWithGenericCode(code_t nCode, fn_t&& GetDescription, const wchar_t* RESTRICT lpszDescriptionFormat, DescriptionFormatParams... formatting_params) constructor.
- See also
- ExceptionWithGenericCode(code_t nCode, fn_t&& GetDescription, const char_t* restrict lpszDescriptionFormat, DescriptionFormatParams... formatting_params);
ExceptionWithGenericCode(code_t nCode, fn_t&& GetDescription, Exception::vararg_tag_t, _In_opt_z_ const char_t* RESTRICT lpszDescriptionFormat, std::va_list ap);
ExceptionWithGenericCode(code_t nCode, Exception::vararg_tag_t, _In_opt_z_ const char_t* RESTRICT lpszDescriptionFormat, std::va_list ap);
ExceptionWithGenericCode(code_t nCode, std::nullptr_t, _In_opt_z_ const char_t* RESTRICT lpszDescriptionFormat, DescriptionFormatParams... formatting_params).