diff --git a/.hunspell.en.dic b/.hunspell.en.dic index a99eefd5..8e12e58e 100644 --- a/.hunspell.en.dic +++ b/.hunspell.en.dic @@ -328,6 +328,7 @@ compopt config configs contrib +conun cov cp cr diff --git a/tcl/report.tcl.in b/tcl/report.tcl.in index a3c81233..22681498 100644 --- a/tcl/report.tcl.in +++ b/tcl/report.tcl.in @@ -102,6 +102,14 @@ proc __reportErrorAndExit {message} { error $message {} MODULES_ERR_RENDERED } +proc reportErrorOrWarningIfForced {message} { + if {[getState force]} { + reportWarning $message + } else { + reportError $message + } +} + proc reportInternalBug {message {modfile {}} {title {Module ERROR}}} { reportError [formatInternalBugMsg $message $modfile] 0 $title me } diff --git a/tcl/subcmd.tcl.in b/tcl/subcmd.tcl.in index baf1a6ee..4ffeddcc 100644 --- a/tcl/subcmd.tcl.in +++ b/tcl/subcmd.tcl.in @@ -1320,17 +1320,13 @@ proc cmdModuleLoad {context uasked tryload loadany tag_list args} { if {$report_con && [info exists conmsg]} { reportWarning $conmsg } - # raise conun-specific msg to top level if attempted - if {$retisconun} { - reportWarning [getErrConUnMsg $moddecconlist] 1 - } } elseif {$doescon} { if {$retisconun} { if {[info exists conmsg]} { reportError $conmsg } - # raise conun-specific msg to top level if attempted - knerror [getErrConUnMsg $moddecconlist] + # conun-specific msg has already been reported + knerror {} } else { knerror $conmsg } @@ -1823,6 +1819,10 @@ proc cmdModuleUnload {context match auto force onlyureq onlyndep args} { reportError "Unload of switched-off [getModuleDesignation\ loaded $modname] failed" } + conun { + reportErrorOrWarningIfForced [getErrConUnMsg\ + [getModuleDesignation loaded $modname]] + } } }