MCPcopy Create free account
hub / github.com/daniele77/cli / StdExceptionHandler

Method StdExceptionHandler

include/cli/cli.h:162–165  ·  view source on GitHub ↗

* @brief Add an handler that will be called when a @c std::exception (or derived) is thrown inside a command handler. * If an exception handler is not set, the exception will be logget on the session output stream. * * @param handler the function to be called when an exception is thrown, taking a @c std::ostream& parameter to write on that session console, * th

Source from the content-addressed store, hash-verified

160 * the command entered and the exception thrown.
161 */
162 void StdExceptionHandler(const std::function< void(std::ostream&, const std::string& cmd, const std::exception&) >& handler)
163 {
164 exceptionHandler = handler;
165 }
166
167 /**
168 * @brief Add an handler that will be called when the user enter a wrong command (not existing command or having wrong parameters).

Callers 5

BOOST_AUTO_TEST_CASEFunction · 0.80
mainFunction · 0.80
UserInterfaceMethod · 0.80
UserInterfaceMethod · 0.80
FeedMethod · 0.80

Calls 1

whatMethod · 0.80

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64