diff --git a/src/lib/variant.hpp b/src/lib/variant.hpp index 87621e14b..fe7720055 100644 --- a/src/lib/variant.hpp +++ b/src/lib/variant.hpp @@ -341,15 +341,16 @@ namespace lib { + static string indicateTypeMismatch (Buffer&); + + static Buff& downcast (Buffer& b) { Buff* buff = dynamic_cast (&b); if (!buff) - throw error::Logic("Variant type mismatch: " - "the given variant record does not hold " - "a value of the type requested here" + throw error::Logic(indicateTypeMismatch(b) ,error::LERR_(WRONG_TYPE)); else return *buff; @@ -550,6 +551,27 @@ namespace lib { return util::typedString (this->access()); } + /** + * error message when accessing the variant content with wrong type assumptions. + * @remark while this diagnostics can be crucial for finding bugs, we avoid + * including \ref format-string.hpp, since lib::Variant is used pervasively + * as part of lib::diff::GenNode. Especially in development builds, we observed + * a tangible leverage on executable size. Thus we implement the protection + * against follow-up exceptions explicitly here. + */ + template + template + inline string + Variant::Buff::indicateTypeMismatch(Variant::Buffer& target) + { + try { + return "Variant type mismatch: expected value of type «" + + lib::meta::typeStr()+"», " + + "however the given variant record is " + + string{target}; + } + catch(...) { return lib::meta::FAILURE_INDICATOR; } + } }// namespace lib diff --git a/src/proc/cmd/meta-cmd.cpp b/src/proc/cmd/meta-cmd.cpp index 6bed40e8c..25754046f 100644 --- a/src/proc/cmd/meta-cmd.cpp +++ b/src/proc/cmd/meta-cmd.cpp @@ -45,6 +45,7 @@ #include "lib/format-string.hpp" //////////////////////////////////////////////////////////////TICKET #1099 : include needed temporarily //#include "lib/symbol.hpp" +#include #include using lib::hash::LuidH; @@ -58,6 +59,7 @@ using lib::diff::GenNode; //using util::cStr; using util::_Fmt; //////////////////////////////////////////////////////////////TICKET #1099 : include needed temporarily using std::string; +using boost::lexical_cast; namespace proc { @@ -211,7 +213,9 @@ COMMAND_DEFINITION (test_meta_markAction) def.operation ([](string actionID, string message) { ID errorLogID = gui::interact::Wizard::getErrorLogID(); - GuiNotification::facade().mark (errorLogID, GenNode{actionID, message}); + GuiNotification::facade().mark (errorLogID + ,actionID=="expand"? GenNode{actionID, lexical_cast (message)} ///////////FIXME : lexical_cast is not suitable. We need a generic bool parse function! + : GenNode{actionID, message}); }) .captureUndo ([](string actionID, string message) -> string { diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 95c843a50..f5e4089e8 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -2911,7 +2911,7 @@ - + @@ -2944,6 +2944,77 @@ + + + + + + +

+ ...weil der Payload-Typ für diesen Aufruf bool ist, +

+

+ und nicht string wie für alle anderen state marks +

+ + +
+ +
+ + + + + + + + +

+ k +

+ + +
+ + + + + + + + + + + + + + + + + + + + + + +

+ ein ZombieCheck spricht an +

+ + +
+ + + + + + + + +
+
+
+