docopt / docopt.cpp

C++11 port of docopt
Boost Software License 1.0
1.05k stars 146 forks source link

Handling conversion errors #40

Closed godrays closed 4 years ago

godrays commented 8 years ago

try { std::cout << args["<x>"].asLong() << std::endl; } catch (std::exception & e) { std::cout << e.what() << std::end; }

If stol fails due to conversion, following message is shown:

stol: no conversion

Can it be more specific? Like: