From 30e436bba66673e17728e3ba3291b58dd16c1696 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 7 Jul 2018 10:46:25 +0200 Subject: Add optional message to invalid_option exception --- cli/runtime-header.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cli/runtime-header.cxx') diff --git a/cli/runtime-header.cxx b/cli/runtime-header.cxx index e9e797a..60e90cc 100644 --- a/cli/runtime-header.cxx +++ b/cli/runtime-header.cxx @@ -170,7 +170,8 @@ generate_runtime_header (context& ctx) << "~invalid_value () throw ();" << endl << "invalid_value (const std::string& option," << endl - << "const std::string& value);" + << "const std::string& value," << endl + << "const std::string& message = std::string ());" << endl << "const std::string&" << endl << "option () const;" @@ -178,6 +179,9 @@ generate_runtime_header (context& ctx) << "const std::string&" << endl << "value () const;" << endl + << "const std::string&" << endl + << "message () const;" + << endl << "virtual void" << endl << "print (" << os_type << "&) const;" << endl @@ -187,6 +191,7 @@ generate_runtime_header (context& ctx) << "private:" << endl << "std::string option_;" << "std::string value_;" + << "std::string message_;" << "};"; os << "class eos_reached: public exception" -- cgit v1.1