Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
disable stacktrace option for Option
  • Loading branch information
herumi committed Nov 14, 2014
1 parent 5873fdf commit 9610af0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions include/cybozu/exception.hpp
Expand Up @@ -61,12 +61,14 @@ class Exception : public std::exception {
mutable std::string stackTrace_;
#endif
public:
explicit Exception(const std::string& name = "")
explicit Exception(const std::string& name = "", bool enableStackTrace = true)
: str_(name)
{
#ifdef CYBOZU_EXCEPTION_WITH_STACKTRACE
, stackTrace_(cybozu::StackTrace().toString())
if (enableStackTrace) stackTrace_ = cybozu::StackTrace().toString();
#else
cybozu::disable_warning_unused_variable(enableStackTrace);
#endif
{
}
~Exception() throw() {}
const char *what() const throw() { return toString().c_str(); }
Expand Down
2 changes: 1 addition & 1 deletion include/cybozu/option.hpp
Expand Up @@ -64,7 +64,7 @@ struct OptionError : public cybozu::Exception {
Type type;
int argPos;
OptionError()
: cybozu::Exception("OptionError")
: cybozu::Exception("OptionError", false)
, type(NoError)
, argPos(0)
{
Expand Down
Empty file modified mk.bat 100755 → 100644
Empty file.

0 comments on commit 9610af0

Please sign in to comment.