throw Exception do not include "Error: " in what

This commit is contained in:
James Cherry 2020-03-07 13:44:52 -08:00
parent ae61892d7d
commit 3277f1b1d6
6 changed files with 11 additions and 6 deletions

View File

@ -496,6 +496,11 @@ set_property(SOURCE ${STA_SWIG_FILE}
-I${STA_HOME}/verilog
)
set_property(SOURCE ${STA_SWIG_FILE}
PROPERTY DEPENDS
${STA_HOME}/tcl/Exception.i
)
swig_add_library(sta_swig
LANGUAGE tcl
TYPE STATIC

View File

@ -92,7 +92,7 @@ PropertyUnknown::PropertyUnknown(const char *type,
const char *
PropertyUnknown::what() const noexcept
{
return stringPrint("Error: %s objects do not have a %s property.",
return stringPrint("%s objects do not have a %s property.",
type_, property_);
}

View File

@ -239,7 +239,7 @@ SubcktEndsMissing::SubcktEndsMissing(const char *cell_name,
const char *subckt_filename) :
Exception()
{
what_ = "Error: spice subckt for cell ";
what_ = "spice subckt for cell ";
what_ += cell_name;
what_ += " missing .ends in ";
what_ += subckt_filename;

View File

@ -25,7 +25,7 @@
exit(0);
}
catch (std::exception &excp) {
Tcl_SetResult(interp, const_cast<char*>(excp.what()), TCL_VOLATILE);
Tcl_AppendResult(interp, "Error: ", excp.what(), nullptr);
return TCL_ERROR;
}
}

View File

@ -90,7 +90,7 @@ proc check_for_key_args { cmd arg_var } {
while { $args != "" } {
set arg [lindex $args 0]
if { [is_keyword_arg $arg] } {
sta_warn "$cmd $arg is not a known keyword or flag."
sta_error "$cmd $arg is not a known keyword or flag."
} else {
lappend args_rtn $arg
}

View File

@ -58,7 +58,7 @@ FileNotReadable::FileNotReadable(const char *filename) :
const char *
FileNotReadable::what() const noexcept
{
return stringPrintTmp("Error: cannot read file %s.", filename_);
return stringPrintTmp("cannot read file %s.", filename_);
}
FileNotWritable::FileNotWritable(const char *filename) :
@ -69,7 +69,7 @@ FileNotWritable::FileNotWritable(const char *filename) :
const char *
FileNotWritable::what() const noexcept
{
return stringPrintTmp("Error: cannot write file %s.", filename_);
return stringPrintTmp("cannot write file %s.", filename_);
}
} // namespace