exceptions
This commit is contained in:
parent
71b643b0f1
commit
0cee0731ab
|
|
@ -25,7 +25,8 @@
|
|||
exit(0);
|
||||
}
|
||||
catch (std::exception &excp) {
|
||||
Tcl_AppendResult(interp, "Error: ", excp.what(), nullptr);
|
||||
char *msg = stringPrint("Error: %s", excp.what());
|
||||
Tcl_SetResult(interp, msg, nullptr);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,14 +112,14 @@ class CmdErrorNetworkNotLinked : public Exception
|
|||
{
|
||||
public:
|
||||
virtual const char *what() const noexcept
|
||||
{ return "Error: no network has been linked."; }
|
||||
{ return "no network has been linked."; }
|
||||
};
|
||||
|
||||
class CmdErrorNetworkNotEditable : public Exception
|
||||
{
|
||||
public:
|
||||
virtual const char *what() const noexcept
|
||||
{ return "Error: network does not support edits."; }
|
||||
{ return "network does not support edits."; }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -116,8 +116,7 @@ PatternMatch::matchNoCase(const char *str) const
|
|||
RegexpCompileError::RegexpCompileError(const char *pattern) :
|
||||
Exception()
|
||||
{
|
||||
const char *msg = "Error: TCL failed to compile regular expression '%s'.";
|
||||
error_ = stringPrintTmp(msg, pattern);
|
||||
error_ = stringPrint("TCL failed to compile regular expression '%s'.", pattern);
|
||||
}
|
||||
|
||||
const char *
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class RegexpCompileError : public Exception
|
|||
public:
|
||||
explicit RegexpCompileError(const char *error);
|
||||
virtual ~RegexpCompileError() noexcept {}
|
||||
virtual const char *what() const throw();
|
||||
virtual const char *what() const noexcept;
|
||||
|
||||
private:
|
||||
const char *error_;
|
||||
|
|
|
|||
Loading…
Reference in New Issue