From 89d93a13e42e6545b18a45d363ad6bed8b2c07ae Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 2 Apr 2018 01:48:51 +0200 Subject: [PATCH] Modernise Unknown Exception handler and Exception messages --- src/backend/thread-wrapper.hpp | 4 +- src/common/advice/index.hpp | 2 +- src/common/interface-facade-link.hpp | 2 +- src/common/query/defs-manager-impl.hpp | 2 +- src/gui/ctrl/playback-controller.cpp | 2 +- src/lib/depend.hpp | 2 +- src/lib/diff/list-diff-application.hpp | 8 +-- src/lib/error-exception.cpp | 66 +++++++++++++------ src/lib/linked-elements.hpp | 4 +- src/lib/meta/util.hpp | 2 +- src/lib/opaque-holder.hpp | 10 +-- src/lib/optional-ref.hpp | 4 +- src/lib/scoped-collection.hpp | 8 +-- src/lib/searchpath.hpp | 4 +- src/lib/sync.hpp | 4 +- src/lib/thread-local.hpp | 2 +- src/lib/time/timecode.cpp | 4 +- src/lib/time/timevalue.hpp | 2 +- src/lib/variant.hpp | 2 +- src/lib/wrapper.hpp | 6 +- src/proc/asset/media.cpp | 2 +- src/proc/asset/struct-factory-impl.hpp | 2 +- src/proc/assetmanager.cpp | 4 +- src/proc/control/command-mutation.hpp | 4 +- src/proc/control/command-queue.hpp | 2 +- src/proc/control/command-setup.cpp | 12 ++-- src/proc/control/command-simple-closure.hpp | 2 +- src/proc/control/command-storage-holder.hpp | 2 +- src/proc/control/command.cpp | 10 +-- src/proc/control/memento-tie.hpp | 2 +- src/proc/engine/buffer-metadata.hpp | 12 ++-- src/proc/engine/buffer-provider.cpp | 5 +- src/proc/engine/buffhandle-attach.hpp | 2 +- src/proc/engine/buffhandle.hpp | 2 +- src/proc/engine/channel-descriptor.hpp | 2 +- src/proc/mobject/mobject-ref.hpp | 6 +- src/proc/mobject/output-mapping.hpp | 2 +- src/proc/mobject/placement-ref.hpp | 4 +- src/proc/mobject/session/placement-index.cpp | 2 +- src/proc/mobject/session/placement-index.hpp | 6 +- src/proc/mobject/session/scope-path.cpp | 4 +- src/proc/mobject/session/scope.cpp | 2 +- src/proc/mobject/session/segmentation.cpp | 2 +- .../mobject/session/sess-manager-impl.cpp | 2 +- src/proc/mobject/session/session-impl.cpp | 2 +- src/proc/play/render-configurator.cpp | 2 +- tests/10exception.tests | 2 +- tests/backend/test-fileheader.c | 14 ++-- .../thread-wrapper-self-recognition-test.cpp | 1 - .../basics/dependency-configuration-test.cpp | 4 +- tests/basics/diagnostic-context-test.cpp | 2 +- tests/basics/singleton-subclass-test.cpp | 2 +- .../time/digxel-configurations-test.cpp | 2 +- tests/basics/time/time-control-test.cpp | 2 +- tests/basics/time/time-parsing-test.cpp | 2 +- tests/basics/time/time-value-test.cpp | 2 +- .../application/subsystem-runner-test.cpp | 8 +-- tests/core/proc/asset/entry-id-test.cpp | 2 +- .../control/command-instance-manager-test.cpp | 2 +- tests/core/proc/control/command-use2-test.cpp | 2 +- .../proc/engine/buffer-metadata-key-test.cpp | 4 +- .../core/proc/engine/buffer-metadata-test.cpp | 6 +- .../engine/buffer-provider-protocol-test.cpp | 4 +- .../session/query-focus-stack-test.cpp | 2 +- .../proc/mobject/session/scope-path-test.cpp | 4 +- tests/gui/abstract-tangible-test.cpp | 2 +- tests/gui/interact/ui-coord-resolver-test.cpp | 4 +- tests/gui/interact/ui-coord-test.cpp | 4 +- tests/library/diff/gen-node-basic-test.cpp | 4 +- .../generic-record-representation-test.cpp | 6 +- tests/library/diff/mutation-message-test.cpp | 2 +- .../diff/tree-mutator-binding-test.cpp | 2 +- tests/library/iter-adapter-test.cpp | 2 +- tests/library/iter-cursor-test.cpp | 2 +- tests/library/iter-explorer-test.cpp | 2 +- tests/library/iter-queue-test.cpp | 2 +- tests/library/iter-source-test.cpp | 2 +- tests/library/iter-stack-test.cpp | 2 +- tests/library/iter-tree-explorer-test.cpp | 2 +- tests/library/itertools-test.cpp | 2 +- tests/library/linked-elements-test.cpp | 4 +- tests/library/meta/access-casted-test.cpp | 4 +- tests/library/meta/tuple-record-init-test.cpp | 2 +- .../meta/virtual-copy-support-test.cpp | 6 +- tests/library/multifact-singleton-test.cpp | 2 +- tests/library/opaque-holder-test.cpp | 6 +- tests/library/path-array-test.cpp | 4 +- tests/library/scoped-collection-test.cpp | 2 +- 88 files changed, 201 insertions(+), 175 deletions(-) diff --git a/src/backend/thread-wrapper.hpp b/src/backend/thread-wrapper.hpp index 76ae00792..9595927cc 100644 --- a/src/backend/thread-wrapper.hpp +++ b/src/backend/thread-wrapper.hpp @@ -59,8 +59,8 @@ namespace backend { using lib::Literal; namespace error = lumiera::error; - using error::LUMIERA_ERROR_STATE; - using error::LUMIERA_ERROR_EXTERNAL; + using error::LERR_(STATE); + using error::LERR_(EXTERNAL); typedef struct nobug_flag* NoBugFlag; diff --git a/src/common/advice/index.hpp b/src/common/advice/index.hpp index 0bbdc27d3..6be0a2aa5 100644 --- a/src/common/advice/index.hpp +++ b/src/common/advice/index.hpp @@ -509,7 +509,7 @@ namespace advice { { SelfCheckFailure (Literal failure) : error::Fatal (string("Failed test: ")+failure - ,LUMIERA_ERROR_INDEX_CORRUPTED) + ,LERR_(INDEX_CORRUPTED)) { } }; } diff --git a/src/common/interface-facade-link.hpp b/src/common/interface-facade-link.hpp index 7ba6704c5..580863127 100644 --- a/src/common/interface-facade-link.hpp +++ b/src/common/interface-facade-link.hpp @@ -92,7 +92,7 @@ namespace facade { { if (Accessor::implProxy_) throw error::State("Attempt to open an already opened Facade interface." - , error::LUMIERA_ERROR_LIFECYCLE); + , error::LERR_(LIFECYCLE)); } public: diff --git a/src/common/query/defs-manager-impl.hpp b/src/common/query/defs-manager-impl.hpp index d7e02b283..a392f5b65 100644 --- a/src/common/query/defs-manager-impl.hpp +++ b/src/common/query/defs-manager-impl.hpp @@ -55,7 +55,7 @@ using util::_Fmt; using proc::ConfigResolver; using lumiera::query::QueryHandler; ///////TODO preliminary interface defined in config-rules.hpp -using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY; +using lumiera::query::LERR_(CAPABILITY_QUERY); namespace lumiera{ diff --git a/src/gui/ctrl/playback-controller.cpp b/src/gui/ctrl/playback-controller.cpp index 9152f1943..376600435 100644 --- a/src/gui/ctrl/playback-controller.cpp +++ b/src/gui/ctrl/playback-controller.cpp @@ -62,7 +62,7 @@ namespace ctrl { { if (not instance) throw error::Logic ("GTK UI is not in running state" - , error::LUMIERA_ERROR_LIFECYCLE); + , error::LERR_(LIFECYCLE)); return *instance; } diff --git a/src/lib/depend.hpp b/src/lib/depend.hpp index c5a4ca785..f0579850a 100644 --- a/src/lib/depend.hpp +++ b/src/lib/depend.hpp @@ -168,7 +168,7 @@ namespace lib { creator_ = []() -> OBJ* { throw error::Fatal("Service not available at this point of the Application Lifecycle" - ,error::LUMIERA_ERROR_LIFECYCLE); + ,error::LERR_(LIFECYCLE)); }; } diff --git a/src/lib/diff/list-diff-application.hpp b/src/lib/diff/list-diff-application.hpp index 0d4bb1aa6..a3bb04f38 100644 --- a/src/lib/diff/list-diff-application.hpp +++ b/src/lib/diff/list-diff-application.hpp @@ -91,12 +91,12 @@ namespace diff{ if (end_of_target()) throw error::State(_Fmt("Unable to %s element %s from target as demanded; " "no (further) elements in target sequence") % oper % elm - , LUMIERA_ERROR_DIFF_CONFLICT); + , LERR_(DIFF_CONFLICT)); if (*pos_ != elm) throw error::State(_Fmt("Unable to %s element %s from target as demanded; " "found element %s on current target position instead") % oper % elm % *pos_ - , LUMIERA_ERROR_DIFF_CONFLICT); + , LERR_(DIFF_CONFLICT)); } void @@ -105,7 +105,7 @@ namespace diff{ if (end_of_target()) throw error::State(_Fmt("Premature end of target sequence, still expecting element %s; " "unable to apply diff further.") % elm - , LUMIERA_ERROR_DIFF_CONFLICT); + , LERR_(DIFF_CONFLICT)); } void @@ -114,7 +114,7 @@ namespace diff{ if (targetPos == orig_.end()) throw error::State(_Fmt("Premature end of sequence; unable to locate " "element %s in the remainder of the target.") % elm - , LUMIERA_ERROR_DIFF_CONFLICT); + , LERR_(DIFF_CONFLICT)); } diff --git a/src/lib/error-exception.cpp b/src/lib/error-exception.cpp index b6de638c2..919af2322 100644 --- a/src/lib/error-exception.cpp +++ b/src/lib/error-exception.cpp @@ -40,6 +40,7 @@ #include #include +using util::cStr; using util::isnil; using std::exception; @@ -51,12 +52,12 @@ namespace lumiera { * if an exception reaches one of the top-level * catch clauses. * @todo to be localised + * @todo develop a framework to set more specific yet friendly messages */ inline const string default_usermsg (Error* exception_obj) noexcept { - return string("Sorry, Lumiera encountered an internal error. (") - + util::typeStr(*exception_obj) + ")"; + return "Sorry, Lumiera encountered an internal error."; } CStr @@ -163,23 +164,59 @@ namespace lumiera { - namespace error - { + namespace error { + namespace { + void install_unexpectedException_handler () + { + std::set_terminate (lumiera_unexpectedException); + } + LifecycleHook schedule_ (ON_BASIC_INIT, &install_unexpectedException_handler); + + std::terminate_handler nextHandler = nullptr; + } + - void lumiera_unexpectedException () throw() + void lumiera_unexpectedException () noexcept { - CCStr is_halted + CStr is_halted = "### Lumiera halted due to an unexpected Error ###"; - std::cerr << "\n" << is_halted << "\n\n"; ERROR (NOBUG_ON, "%s", is_halted); + std::cerr << "\n" << is_halted << "\n\n"; - if (CCStr errorstate = lumiera_error ()) + + try { // -----find-out-about-any-Exceptions-------- + auto lastException = std::current_exception(); + if (lastException) { + std::rethrow_exception (lastException); + } + } catch(const lumiera::Error& lerr) { + std::cout << "\n+++ Caught Exception " << lerr.getID() << "\n\n"; + ERROR (NOBUG_ON, "+++ caught %s\n+++ messg: %s\n+++ descr: %s" + , cStr(util::typeStr(lerr)) + , cStr(lerr.getUsermsg()) + , cStr(lerr.what()) + ); + if (not isnil(lerr.rootCause())) + ERROR (NOBUG_ON, "+++ cause: %s",cStr(lerr.rootCause())); + + } catch(const std::exception& e) { + ERROR (NOBUG_ON, "Generic Exception: %s", e.what()); + std::cout << "+++ Caught Exception \"" << e.what() << "\"\n"; + } catch(...) { + ERROR (NOBUG_ON, "FATAL -- unknown exception"); + } + + if (CStr errorstate = lumiera_error ()) ERROR (NOBUG_ON, "last registered error was....\n%s", errorstate); - std::terminate(); + if (nextHandler) + nextHandler(); + else + std::abort(); } + void assertion_terminate (const string& location) { throw Fatal (location, LUMIERA_ERROR_ASSERTION) @@ -187,17 +224,6 @@ namespace lumiera { "an internal consistency check."); } - - void install_unexpectedException_handler () - { - std::set_unexpected (lumiera_unexpectedException); - } - - namespace { - LifecycleHook schedule_ (ON_BASIC_INIT, &install_unexpectedException_handler); - } - - } // namespace error } // namespace lumiera diff --git a/src/lib/linked-elements.hpp b/src/lib/linked-elements.hpp index f4dfc186c..fbf8f6a64 100644 --- a/src/lib/linked-elements.hpp +++ b/src/lib/linked-elements.hpp @@ -72,7 +72,7 @@ namespace lib { namespace error = lumiera::error; - using error::LUMIERA_ERROR_INDEX_BOUNDS; + using error::LERR_(INDEX_BOUNDS); using util::unConst; @@ -495,7 +495,7 @@ namespace lib { if (!p || index) throw error::Logic ("Attempt to access element beyond the end of LinkedElements list" - , LUMIERA_ERROR_INDEX_BOUNDS); + , LERR_(INDEX_BOUNDS)); else return *p; } diff --git a/src/lib/meta/util.hpp b/src/lib/meta/util.hpp index a0236a0f2..5df0dad53 100644 --- a/src/lib/meta/util.hpp +++ b/src/lib/meta/util.hpp @@ -263,7 +263,7 @@ namespace meta { * do want the pointer itself (and not a pointer to the pointer). We then * pass the "object" as so called "glvalue" to the `typeid()` function, * so to get the evaluation of RTTI, when applicable. - * @warning this function does string transformations behind the scenes, + * @warning this function does string transformations behind the scene, * and thus should not be used in performance critical context. Moreover, * the returned type string is not necessarily exact and re-parsable. */ diff --git a/src/lib/opaque-holder.hpp b/src/lib/opaque-holder.hpp index 80e084672..d10324c2e 100644 --- a/src/lib/opaque-holder.hpp +++ b/src/lib/opaque-holder.hpp @@ -80,6 +80,8 @@ namespace lib { namespace error = lumiera::error; + using error::LERR_(BOTTOM_VALUE); + using error::LERR_(WRONG_TYPE); using util::isSameObject; using util::unConst; @@ -134,7 +136,7 @@ namespace lib { return asBase; throw error::Logic ("Unable to convert concrete object to Base interface" - , error::LUMIERA_ERROR_WRONG_TYPE + , LERR_(WRONG_TYPE) ); } }; @@ -219,7 +221,7 @@ namespace lib { getBase() const { throw error::Invalid("accessing empty holder" - , error::LUMIERA_ERROR_BOTTOM_VALUE); + , LERR_(BOTTOM_VALUE)); } virtual void @@ -452,11 +454,11 @@ namespace lib { if (this->empty()) throw error::Invalid("accessing empty holder" - , error::LUMIERA_ERROR_BOTTOM_VALUE); + ,LERR_(BOTTOM_VALUE)); else throw error::Logic ("Attempt to access OpaqueHolder's contents " "specifying incompatible target type" - , error::LUMIERA_ERROR_WRONG_TYPE + , LERR_(WRONG_TYPE) ); } diff --git a/src/lib/optional-ref.hpp b/src/lib/optional-ref.hpp index e4ff6ca15..23e6827c1 100644 --- a/src/lib/optional-ref.hpp +++ b/src/lib/optional-ref.hpp @@ -36,7 +36,7 @@ namespace lib { - using lumiera::error::LUMIERA_ERROR_BOTTOM_VALUE; + using lumiera::error::LERR_(BOTTOM_VALUE); @@ -88,7 +88,7 @@ namespace lib { { if (!isValid()) throw lumiera::error::Logic ("access to this object is (not/yet) enabled" - , LUMIERA_ERROR_BOTTOM_VALUE); + , LERR_(BOTTOM_VALUE)); return *ref_; } diff --git a/src/lib/scoped-collection.hpp b/src/lib/scoped-collection.hpp index d58da5b11..5623cb836 100644 --- a/src/lib/scoped-collection.hpp +++ b/src/lib/scoped-collection.hpp @@ -80,8 +80,8 @@ namespace lib { namespace error = lumiera::error; - using error::LUMIERA_ERROR_CAPACITY; - using error::LUMIERA_ERROR_INDEX_BOUNDS; + using error::LERR_(CAPACITY); + using error::LERR_(INDEX_BOUNDS); @@ -329,7 +329,7 @@ namespace lib { return elements_[index].accessObj(); throw error::Logic ("Attempt to access not (yet) existing object in ScopedCollection" - , LUMIERA_ERROR_INDEX_BOUNDS); + , LERR_(INDEX_BOUNDS)); } @@ -366,7 +366,7 @@ namespace lib { { if (level_ >= capacity_) throw error::State ("ScopedCollection exceeding the initially defined capacity" - , LUMIERA_ERROR_CAPACITY); + , LERR_(CAPACITY)); } diff --git a/src/lib/searchpath.hpp b/src/lib/searchpath.hpp index aec13a3aa..617552b63 100644 --- a/src/lib/searchpath.hpp +++ b/src/lib/searchpath.hpp @@ -55,7 +55,7 @@ namespace lib { namespace fsys = boost::filesystem; LUMIERA_ERROR_DECLARE (FILE_NOT_DIRECTORY); ///< path element points at a file instead of a directory - using error::LUMIERA_ERROR_ITER_EXHAUST; + using error::LERR_(ITER_EXHAUST); /** retrieve the location of the executable */ @@ -102,7 +102,7 @@ namespace lib { { if (!isValid()) throw error::Logic ("Search path exhausted." - ,LUMIERA_ERROR_ITER_EXHAUST); + ,LERR_(ITER_EXHAUST)); string currentPathElement = pos_->str(); ++pos_; diff --git a/src/lib/sync.hpp b/src/lib/sync.hpp index 0a9f8d56a..add2d7ec6 100644 --- a/src/lib/sync.hpp +++ b/src/lib/sync.hpp @@ -284,13 +284,13 @@ namespace lib { wait (BF& predicate, Timeout& waitEndTime) { bool ok = true; - while (ok && !predicate()) + while (ok and !predicate()) if (waitEndTime) ok = Cond::timedwait (&waitEndTime); else ok = Cond::wait (); - if (!ok && lumiera_error_expect(LUMIERA_ERROR_LOCK_TIMEOUT)) return false; + if (not ok and lumiera_error_expect(LUMIERA_ERROR_LOCK_TIMEOUT)) return false; lumiera::throwOnError(); // any other error throws return true; diff --git a/src/lib/thread-local.hpp b/src/lib/thread-local.hpp index 179c22291..98ef3832a 100644 --- a/src/lib/thread-local.hpp +++ b/src/lib/thread-local.hpp @@ -101,7 +101,7 @@ namespace lib { TAR *p(get()); if (!p) throw lumiera::error::State ("dereferencing a thread local NULL pointer" - ,lumiera::error::LUMIERA_ERROR_BOTTOM_VALUE); + ,lumiera::error::LERR_(BOTTOM_VALUE)); return p; } diff --git a/src/lib/time/timecode.cpp b/src/lib/time/timecode.cpp index 8460516a5..90e853bfd 100644 --- a/src/lib/time/timecode.cpp +++ b/src/lib/time/timecode.cpp @@ -77,7 +77,7 @@ namespace time { return frameGrid.timeOf (lexical_cast (match[1])); else throw error::Invalid ("unable to parse framecount \""+frameNumber+"\"" - , LUMIERA_ERROR_INVALID_TIMECODE); + , LERR_(INVALID_TIMECODE)); } @@ -145,7 +145,7 @@ namespace time { } else throw error::Invalid ("unable to parse \""+seconds+"\" as (fractional)seconds" - , LUMIERA_ERROR_INVALID_TIMECODE); + , LERR_(INVALID_TIMECODE)); } diff --git a/src/lib/time/timevalue.hpp b/src/lib/time/timevalue.hpp index ee9e4a03e..ed5ba97f1 100644 --- a/src/lib/time/timevalue.hpp +++ b/src/lib/time/timevalue.hpp @@ -582,7 +582,7 @@ namespace time { { if (n == 0) throw error::Logic ("Degenerated frame grid not allowed" - , error::LUMIERA_ERROR_BOTTOM_VALUE); + , error::LERR_(BOTTOM_VALUE)); return n; } }//(End) implementation helpers diff --git a/src/lib/variant.hpp b/src/lib/variant.hpp index 05426b25e..238320f14 100644 --- a/src/lib/variant.hpp +++ b/src/lib/variant.hpp @@ -312,7 +312,7 @@ namespace lib { throw error::Logic("Variant type mismatch: " "the given variant record does not hold " "a value of the type requested here" - ,error::LUMIERA_ERROR_WRONG_TYPE); + ,error::LERR_(WRONG_TYPE)); else return *buff; } diff --git a/src/lib/wrapper.hpp b/src/lib/wrapper.hpp index 954f52456..67ee87727 100644 --- a/src/lib/wrapper.hpp +++ b/src/lib/wrapper.hpp @@ -58,7 +58,7 @@ namespace wrapper { using util::unConst; using util::isSameObject; using lib::meta::_Fun; - using lumiera::error::LUMIERA_ERROR_BOTTOM_VALUE; + using lumiera::error::LERR_(BOTTOM_VALUE); using std::function; @@ -272,7 +272,7 @@ namespace wrapper { { if (!created_) throw lumiera::error::State ("accessing uninitialised value/ref wrapper" - , LUMIERA_ERROR_BOTTOM_VALUE); + , LERR_(BOTTOM_VALUE)); return access(); } @@ -339,7 +339,7 @@ namespace wrapper { { if (!content_) throw lumiera::error::State ("accessing uninitialised reference wrapper" - , LUMIERA_ERROR_BOTTOM_VALUE); + , LERR_(BOTTOM_VALUE)); return *content_; } diff --git a/src/proc/asset/media.cpp b/src/proc/asset/media.cpp index f1d236bcf..be5c5ccfd 100644 --- a/src/proc/asset/media.cpp +++ b/src/proc/asset/media.cpp @@ -242,7 +242,7 @@ namespace asset { "(multichannel) media. Found parent Media %s.") % mediaref % *mediaref.checkCompound() - ,LUMIERA_ERROR_PART_OF_COMPOUND); + ,LERR_(PART_OF_COMPOUND)); Clip* pC = new Clip (mediaref); return AssetManager::instance().wrap (*pC); } diff --git a/src/proc/asset/struct-factory-impl.hpp b/src/proc/asset/struct-factory-impl.hpp index 1f4d574c1..16239874c 100644 --- a/src/proc/asset/struct-factory-impl.hpp +++ b/src/proc/asset/struct-factory-impl.hpp @@ -70,7 +70,7 @@ namespace asset { using util::isnil; using util::contains; using lumiera::Query; - using lumiera::query::LUMIERA_ERROR_CAPABILITY_QUERY; + using lumiera::query::LERR_(CAPABILITY_QUERY); using lib::query::extractID; using proc::mobject::Session; diff --git a/src/proc/assetmanager.cpp b/src/proc/assetmanager.cpp index 9b7c8a2fa..509b6b98c 100644 --- a/src/proc/assetmanager.cpp +++ b/src/proc/assetmanager.cpp @@ -70,7 +70,7 @@ namespace asset { UnknownID (ID aID) : IDErr(_Fmt("Query for Asset with ID=%d, which up to now " "hasn't been created or encountered.") % aID - ,LUMIERA_ERROR_UNKNOWN_ASSET_ID) + ,LERR_(UNKNOWN_ASSET_ID)) { } }; @@ -80,7 +80,7 @@ namespace asset { : IDErr (_Fmt("Request for Asset(%s), specifying an Asset kind, " "that doesn't match the actual type (and can't be " "casted either).") % idi - ,LUMIERA_ERROR_WRONG_ASSET_KIND) + ,LERR_(WRONG_ASSET_KIND)) { } }; diff --git a/src/proc/control/command-mutation.hpp b/src/proc/control/command-mutation.hpp index 41cf9558b..23f517cc8 100644 --- a/src/proc/control/command-mutation.hpp +++ b/src/proc/control/command-mutation.hpp @@ -80,7 +80,7 @@ namespace control { { if (!clo) throw lumiera::error::State ("Lifecycle error: function arguments not ready", - LUMIERA_ERROR_UNBOUND_ARGUMENTS); + LERR_(UNBOUND_ARGUMENTS)); clo.invoke (func_); } @@ -138,7 +138,7 @@ namespace control { { if (!clo) throw lumiera::error::State ("need additional function arguments to be able to capture UNDO state", - LUMIERA_ERROR_UNBOUND_ARGUMENTS); + LERR_(UNBOUND_ARGUMENTS)); captureMemento_(clo); return *this; diff --git a/src/proc/control/command-queue.hpp b/src/proc/control/command-queue.hpp index a5b54ec3a..60150966a 100644 --- a/src/proc/control/command-queue.hpp +++ b/src/proc/control/command-queue.hpp @@ -76,7 +76,7 @@ namespace control { if (not cmd.canExec()) throw error::Logic(_Fmt("Reject '%s'. Not suitably prepared for invocation: %s") % cmd.getID() % cmd - , LUMIERA_ERROR_UNBOUND_ARGUMENTS); + , LERR_(UNBOUND_ARGUMENTS)); lib::IterQueue::feed (move(cmd)); return *this; diff --git a/src/proc/control/command-setup.cpp b/src/proc/control/command-setup.cpp index 4ad3e4d06..e592325e1 100644 --- a/src/proc/control/command-setup.cpp +++ b/src/proc/control/command-setup.cpp @@ -122,7 +122,7 @@ namespace control { { if (not definitionBlock) throw error::Invalid ("unbound function/closure provided for CommandSetup" - , error::LUMIERA_ERROR_BOTTOM_VALUE); + , error::LERR_(BOTTOM_VALUE)); pendingCmdDefinitions().emplace_front (cmdID_, move(definitionBlock)); return *this; @@ -189,7 +189,7 @@ namespace control { "is currently open for parametrisation and " "not yet dispatched for execution."} % instanceID % invocationID - , LUMIERA_ERROR_DUPLICATE_COMMAND + , LERR_(DUPLICATE_COMMAND) ); // create new clone from the prototype table_[instanceID] = move (Command::get(prototypeID).newInstance()); @@ -219,7 +219,7 @@ namespace control { if (not entry->second) throw error::Logic (_Fmt{"Command instance '%s' is not (yet/anymore) active"} % instanceID - , error::LUMIERA_ERROR_LIFECYCLE); + , error::LERR_(LIFECYCLE)); return entry->second; } @@ -241,11 +241,11 @@ namespace control { "globally registered command definition, " "nor to an previously opened command instance") % instanceID - , LUMIERA_ERROR_INVALID_COMMAND); + , LERR_(INVALID_COMMAND)); if (not entry->second.isValid()) throw error::Logic (_Fmt{"Command instance '%s' is not (yet/anymore) active"} % instanceID - , error::LUMIERA_ERROR_LIFECYCLE); + , error::LERR_(LIFECYCLE)); if (not must_be_bound or entry->second.canExec()) instance = move(entry->second); } @@ -253,7 +253,7 @@ namespace control { throw error::State (_Fmt{"attempt to dispatch command instance '%s' " "without binding all arguments properly beforehand"} % instanceID - , LUMIERA_ERROR_UNBOUND_ARGUMENTS); + , LERR_(UNBOUND_ARGUMENTS)); ENSURE (instance.isValid() and (instance.canExec() or not must_be_bound)); diff --git a/src/proc/control/command-simple-closure.hpp b/src/proc/control/command-simple-closure.hpp index 58c0f47c6..317da7ad4 100644 --- a/src/proc/control/command-simple-closure.hpp +++ b/src/proc/control/command-simple-closure.hpp @@ -138,7 +138,7 @@ namespace control { if (!isValid()) throw lumiera::error::State ("Lifecycle error: can't bind functor, " "command arguments not yet provided", - LUMIERA_ERROR_UNBOUND_ARGUMENTS); + LERR_(UNBOUND_ARGUMENTS)); arguments_->invoke(func); } diff --git a/src/proc/control/command-storage-holder.hpp b/src/proc/control/command-storage-holder.hpp index 9dd50ffdb..6a03ae060 100644 --- a/src/proc/control/command-storage-holder.hpp +++ b/src/proc/control/command-storage-holder.hpp @@ -145,7 +145,7 @@ namespace control { if (!isValid()) throw lumiera::error::State ("Lifecycle error: can't bind functor, " "command arguments not yet provided", - LUMIERA_ERROR_UNBOUND_ARGUMENTS); + LERR_(UNBOUND_ARGUMENTS)); arguments_->invoke(func); } diff --git a/src/proc/control/command.cpp b/src/proc/control/command.cpp index e266da1aa..ffd4518c0 100644 --- a/src/proc/control/command.cpp +++ b/src/proc/control/command.cpp @@ -80,7 +80,7 @@ namespace control { REQUIRE (handle); if (!handle->isValid()) throw error::Invalid (operation_descr+" an undefined command" - , LUMIERA_ERROR_INVALID_COMMAND); + , LERR_(INVALID_COMMAND)); } void @@ -89,7 +89,7 @@ namespace control { REQUIRE (handle); if (!handle->canExec()) throw error::State ("Lifecycle error: command arguments not bound" - , LUMIERA_ERROR_UNBOUND_ARGUMENTS); + , LERR_(UNBOUND_ARGUMENTS)); } void @@ -98,7 +98,7 @@ namespace control { REQUIRE (handle); if (!handle->canUndo()) throw error::State ("Lifecycle error: command has not yet captured UNDO information" - , LUMIERA_ERROR_UNBOUND_ARGUMENTS); + , LERR_(UNBOUND_ARGUMENTS)); } } @@ -129,7 +129,7 @@ namespace control { Command cmd = CommandRegistry::instance().queryIndex (cmdID); if (!cmd) throw error::Invalid(_Fmt("Command \"%s\" not found") % cmdID - , LUMIERA_ERROR_INVALID_COMMAND); + , LERR_(INVALID_COMMAND)); ENSURE (cmdID == CommandRegistry::instance().findDefinition(cmd)); return cmd; @@ -240,7 +240,7 @@ namespace control { "ID \"%s\" is already in use") % *this % newCmdID - , LUMIERA_ERROR_DUPLICATE_COMMAND); + , LERR_(DUPLICATE_COMMAND)); } diff --git a/src/proc/control/memento-tie.hpp b/src/proc/control/memento-tie.hpp index 91d619617..dfa290fd7 100644 --- a/src/proc/control/memento-tie.hpp +++ b/src/proc/control/memento-tie.hpp @@ -178,7 +178,7 @@ namespace control { { if (!isCaptured_) throw lumiera::error::State ("need to invoke memento state capturing beforehand", - LUMIERA_ERROR_MISSING_MEMENTO); + LERR_(MISSING_MEMENTO)); return memento_; } diff --git a/src/proc/engine/buffer-metadata.hpp b/src/proc/engine/buffer-metadata.hpp index dcc23dc63..90a5589df 100644 --- a/src/proc/engine/buffer-metadata.hpp +++ b/src/proc/engine/buffer-metadata.hpp @@ -126,8 +126,8 @@ namespace engine { namespace metadata { - using error::LUMIERA_ERROR_LIFECYCLE; - using error::LUMIERA_ERROR_BOTTOM_VALUE; + using error::LERR_(LIFECYCLE); + using error::LERR_(BOTTOM_VALUE); namespace { // details of hash calculation template @@ -242,7 +242,7 @@ namespace engine { { if (nontrivial(this->instanceFunc_)) throw error::Logic ("unable to supersede an already attached TypeHandler" - , LUMIERA_ERROR_LIFECYCLE); + , LERR_(LIFECYCLE)); instanceFunc_ = ref.instanceFunc_; } @@ -399,7 +399,7 @@ namespace engine { if (NIL == state_) throw error::Fatal ("Buffer metadata entry with state==NIL encountered." "State transition logic broken (programming error)" - , LUMIERA_ERROR_LIFECYCLE); + , LERR_(LIFECYCLE)); } void @@ -409,7 +409,7 @@ namespace engine { throw error::Logic ("Buffer is inaccessible (marked as free). " "Need a new buffer pointer in order to lock an entry. " "You should invoke markLocked(buffer) prior to access." - , LUMIERA_ERROR_LIFECYCLE ); + , LERR_(LIFECYCLE)); } void @@ -417,7 +417,7 @@ namespace engine { { if (FREE != state_) throw error::Logic ("Buffer already in use" - , LUMIERA_ERROR_LIFECYCLE ); + , LERR_(LIFECYCLE)); REQUIRE (!buffer_, "Buffer marked as free, " "but buffer pointer is set."); } diff --git a/src/proc/engine/buffer-provider.cpp b/src/proc/engine/buffer-provider.cpp index 9a25711a8..59bb5c215 100644 --- a/src/proc/engine/buffer-provider.cpp +++ b/src/proc/engine/buffer-provider.cpp @@ -211,7 +211,7 @@ namespace engine { REQUIRE (!metaEntry.isTypeKey()); if (!metaEntry.isLocked()) throw error::Logic ("unable to attach an object because buffer isn't locked for use" - , LUMIERA_ERROR_LIFECYCLE); + , LERR_(LIFECYCLE)); metaEntry.useTypeHandlerFrom (refEntry); // EX_STRONG } @@ -307,8 +307,7 @@ namespace engine { BuffHandle::takeOwnershipFor(BufferDescriptor const& type) { if (!this->isValid()) - throw error::Logic ("attaching an object requires an buffer in locked state" - , LUMIERA_ERROR_LIFECYCLE); + throw error::Logic ("attaching an object requires an buffer in locked state", LERR_(LIFECYCLE)); if (this->size() < type.determineBufferSize()) throw error::Logic ("insufficient buffer size to hold an instance of that type"); diff --git a/src/proc/engine/buffhandle-attach.hpp b/src/proc/engine/buffhandle-attach.hpp index f0447bcad..9a26aad06 100644 --- a/src/proc/engine/buffhandle-attach.hpp +++ b/src/proc/engine/buffhandle-attach.hpp @@ -120,7 +120,7 @@ namespace engine { { if (!pBuffer_) throw error::Logic ("buffer not (yet) locked for access by clients" - , LUMIERA_ERROR_LIFECYCLE); + , LERR_(LIFECYCLE)); return *reinterpret_cast (pBuffer_); } diff --git a/src/proc/engine/buffhandle.hpp b/src/proc/engine/buffhandle.hpp index 6a631d5ca..fb437f2db 100644 --- a/src/proc/engine/buffhandle.hpp +++ b/src/proc/engine/buffhandle.hpp @@ -60,7 +60,7 @@ namespace proc { namespace engine { namespace error = lumiera::error; - using error::LUMIERA_ERROR_LIFECYCLE; + using error::LERR_(LIFECYCLE); using lib::HashVal; diff --git a/src/proc/engine/channel-descriptor.hpp b/src/proc/engine/channel-descriptor.hpp index a252f8da9..4b155a153 100644 --- a/src/proc/engine/channel-descriptor.hpp +++ b/src/proc/engine/channel-descriptor.hpp @@ -45,7 +45,7 @@ namespace proc { namespace engine { namespace error = lumiera::error; - using error::LUMIERA_ERROR_LIFECYCLE; + using error::LERR_(LIFECYCLE); using lib::HashVal; diff --git a/src/proc/mobject/mobject-ref.hpp b/src/proc/mobject/mobject-ref.hpp index f45d8fe31..282ff0efa 100644 --- a/src/proc/mobject/mobject-ref.hpp +++ b/src/proc/mobject/mobject-ref.hpp @@ -109,7 +109,7 @@ namespace mobject { { if (!smPtr_) throw error::State("Lifecycle error: MObject ref not activated" - ,LUMIERA_ERROR_BOTTOM_MOBJECTREF); + , LERR_(BOTTOM_MOBJECTREF)); ENSURE (INSTANCEOF (MO, smPtr_.get())); return smPtr_.operator-> (); @@ -120,7 +120,7 @@ namespace mobject { { if (!isValid()) throw error::State("Accessing inactive MObject ref" - ,LUMIERA_ERROR_BOTTOM_MOBJECTREF); + , LERR_(BOTTOM_MOBJECTREF)); ENSURE (INSTANCEOF (MO, smPtr_.get())); return *pRef_; @@ -167,7 +167,7 @@ namespace mobject { { if (!isValid()) throw error::State("Attempt to attach a child to an inactive MObject ref" - , LUMIERA_ERROR_BOTTOM_MOBJECTREF); + , LERR_(BOTTOM_MOBJECTREF)); MORef newInstance; PlacementMO::ID thisScope = pRef_; return newInstance.activate ( diff --git a/src/proc/mobject/output-mapping.hpp b/src/proc/mobject/output-mapping.hpp index 92d1ee9a4..1cdec240c 100644 --- a/src/proc/mobject/output-mapping.hpp +++ b/src/proc/mobject/output-mapping.hpp @@ -218,7 +218,7 @@ namespace mobject { { if (not isValid()) throw error::Logic ("attempt to resolve an unconnected output mapping" - , error::LUMIERA_ERROR_UNCONNECTED); + , error::LERR_(UNCONNECTED)); return resolve(); } diff --git a/src/proc/mobject/placement-ref.hpp b/src/proc/mobject/placement-ref.hpp index a9e11caeb..100c6633b 100644 --- a/src/proc/mobject/placement-ref.hpp +++ b/src/proc/mobject/placement-ref.hpp @@ -271,14 +271,14 @@ namespace proc { { if (!placementID) throw error::Logic ("Attempt to access a NIL PlacementRef" - ,LUMIERA_ERROR_BOTTOM_PLACEMENTREF); + , LERR_(BOTTOM_PLACEMENTREF)); Placement & genericPlacement (session::SessionServiceFetch::resolveID (placementID)); // may throw REQUIRE (genericPlacement.isValid()); if (!(genericPlacement.template isCompatible())) throw error::Invalid("actual type of the resolved placement is incompatible" - , LUMIERA_ERROR_INVALID_PLACEMENTREF); + , LERR_(INVALID_PLACEMENTREF)); ////////////////////////TODO: 1. better message, including type? ////////////////////////TODO: 2. define a separate error-ID for the type mismatch! diff --git a/src/proc/mobject/session/placement-index.cpp b/src/proc/mobject/session/placement-index.cpp index 80f42fbc5..1779754d8 100644 --- a/src/proc/mobject/session/placement-index.cpp +++ b/src/proc/mobject/session/placement-index.cpp @@ -515,7 +515,7 @@ namespace session { if (!contains (targetScope)) throw error::Logic ("Specified a non-registered Placement as scope " "while adding another Placement to the index" - ,LUMIERA_ERROR_INVALID_SCOPE); ////////////////TICKET #197 + ,LERR_(INVALID_SCOPE)); ////////////////TICKET #197 return pTab_->addEntry(newObj, targetScope); } diff --git a/src/proc/mobject/session/placement-index.hpp b/src/proc/mobject/session/placement-index.hpp index d3b62c62e..480be0528 100644 --- a/src/proc/mobject/session/placement-index.hpp +++ b/src/proc/mobject/session/placement-index.hpp @@ -266,7 +266,7 @@ namespace session { "while the actual type of the pointee (MObject) " "registered within the index isn't compatible with the " "requested specific MObject subclass" - ,LUMIERA_ERROR_PLACEMENT_TYPE); + , LERR_(PLACEMENT_TYPE)); } inline void @@ -274,10 +274,10 @@ namespace session { { if (!id) throw lumiera::error::Logic ("Encountered a NIL Placement-ID marker" - ,LUMIERA_ERROR_BOTTOM_PLACEMENTREF); + , LERR_(BOTTOM_PLACEMENTREF)); if (!idx.contains (id)) throw lumiera::error::Invalid ("Accessing Placement not registered within the index" - ,LUMIERA_ERROR_NOT_IN_SESSION); ///////////////////////TICKET #197 + , LERR_(NOT_IN_SESSION)); ///////////////////////TICKET #197 } }//(End) shortcuts diff --git a/src/proc/mobject/session/scope-path.cpp b/src/proc/mobject/session/scope-path.cpp index 00c1f0266..d660d2ca7 100644 --- a/src/proc/mobject/session/scope-path.cpp +++ b/src/proc/mobject/session/scope-path.cpp @@ -71,7 +71,7 @@ namespace session { REQUIRE (path); if (path->empty()) throw error::Logic (operation_descr+" an empty placement scope path" - , LUMIERA_ERROR_EMPTY_SCOPE_PATH); + , LERR_(EMPTY_SCOPE_PATH)); } }//(End) helpers @@ -319,7 +319,7 @@ namespace session { ___check_notBottom (this, "Navigating"); if (!target.isValid()) throw error::Invalid ("can't navigate to a target scope outside the model" - , LUMIERA_ERROR_INVALID_SCOPE); + , LERR_(INVALID_SCOPE)); std::vector otherPath; append_all (discoverScopePath(target), otherPath); diff --git a/src/proc/mobject/session/scope.cpp b/src/proc/mobject/session/scope.cpp index 8a8d13239..d54f11b87 100644 --- a/src/proc/mobject/session/scope.cpp +++ b/src/proc/mobject/session/scope.cpp @@ -215,7 +215,7 @@ namespace session { { if (isRoot()) throw lumiera::error::Invalid ("can't get parent of root scope" - , LUMIERA_ERROR_NO_PARENT_SCOPE); + , LERR_(NO_PARENT_SCOPE)); return SessionServiceExploreScope::getScope (*anchor_); } diff --git a/src/proc/mobject/session/segmentation.cpp b/src/proc/mobject/session/segmentation.cpp index 17b8380f0..cd88eec32 100644 --- a/src/proc/mobject/session/segmentation.cpp +++ b/src/proc/mobject/session/segmentation.cpp @@ -58,7 +58,7 @@ namespace session { // return theGlobalRegistry(); // // throw error::State ("global model port registry is not accessible" -// , LUMIERA_ERROR_BUILDER_LIFECYCLE); +// , LERR_(BUILDER_LIFECYCLE)); //} diff --git a/src/proc/mobject/session/sess-manager-impl.cpp b/src/proc/mobject/session/sess-manager-impl.cpp index 9530936fc..920f1810a 100644 --- a/src/proc/mobject/session/sess-manager-impl.cpp +++ b/src/proc/mobject/session/sess-manager-impl.cpp @@ -79,7 +79,7 @@ namespace session { { ERROR (progress, "Unrecoverable Failure while creating the empty default session."); throw lumiera::error::Fatal ( "Failure while creating the basic session object. System halted." - , LUMIERA_ERROR_CREATE_SESSION ); + , LERR_(CREATE_SESSION)); } diff --git a/src/proc/mobject/session/session-impl.cpp b/src/proc/mobject/session/session-impl.cpp index 40c00d68b..c176e897f 100644 --- a/src/proc/mobject/session/session-impl.cpp +++ b/src/proc/mobject/session/session-impl.cpp @@ -120,7 +120,7 @@ namespace session { { if (Scope(placement).isRoot()) throw error::Invalid ("Can't detach the model root." - , LUMIERA_ERROR_INVALID_SCOPE); + , LERR_(INVALID_SCOPE)); QueryFocus currentFocus; currentFocus.shift (Scope(placement).getParent()); diff --git a/src/proc/play/render-configurator.cpp b/src/proc/play/render-configurator.cpp index 73521fcdb..ac26b7229 100644 --- a/src/proc/play/render-configurator.cpp +++ b/src/proc/play/render-configurator.cpp @@ -78,7 +78,7 @@ namespace play { OutputSlot& slot = outputResolver_->getOutputFor (port); if (!slot.isFree()) throw error::State("unable to acquire a suitable output slot" /////////////////////TICKET #197 #816 - , LUMIERA_ERROR_CANT_PLAY); + , LERR_(CANT_PLAY)); return slot; } diff --git a/tests/10exception.tests b/tests/10exception.tests index fb151a375..a2bafedf7 100644 --- a/tests/10exception.tests +++ b/tests/10exception.tests @@ -14,7 +14,7 @@ out: intermediate handler caught: LUMIERA_ERROR_EXTERNAL:failure in external ser out: caught lumiera::Error: LUMIERA_ERROR_STATE:unforeseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service \(test-7\). out: intermediate handler caught: LUMIERA_ERROR_EXTERNAL:failure in external service \(test-8\).....will rethrow as error::State out: 2nd intermediate handler caught: LUMIERA_ERROR_STATE:unforeseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service \(test-8\).....will rethrow as error::Config -out: caught lumiera::Error: LUMIERA_ERROR_CONFIG:misconfiguration -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service \(test-8\)\. +out: caught error::Invalid: LUMIERA_ERROR_CONFIG:misconfiguration -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service \(test-8\)\. out: caught lumiera::Error: LUMIERA_ERROR_LIFE_AND_UNIVERSE:and everything\? \(what is the answer\?\)\. out: caught error::Logic: LUMIERA_ERROR_LOGIC:internal logic broken \(the big bang\). -- caused by: LUMIERA_ERROR_LIFE_AND_UNIVERSE:and everything\? \(what is the answer\?\)\. return: 0 diff --git a/tests/backend/test-fileheader.c b/tests/backend/test-fileheader.c index 70985b67c..6787e4c56 100644 --- a/tests/backend/test-fileheader.c +++ b/tests/backend/test-fileheader.c @@ -69,7 +69,7 @@ TEST (create_nowrite) { lumiera_fileheader header = lumiera_fileheader_create (file, "TEST", 0, sizeof (lumiera_fileheader), NULL); - CHECK(lumiera_error() == LUMIERA_ERROR_FILEHEADER_NOWRITE); + CHECK (lumiera_error() == LUMIERA_ERROR_FILEHEADER_NOWRITE); lumiera_fileheader_close (&header, LUMIERA_FILEHEADER_FLAG_CLEAN); } @@ -91,8 +91,8 @@ TEST (acquire_wrongheader) sizeof (lumiera_fileheader), LUMIERA_FILEHEADER_FLAG_CLEAN, LUMIERA_FILEHEADER_FLAG_CLEAN); - CHECK(!header.header); - CHECK(lumiera_error() == LUMIERA_ERROR_FILEHEADER_HEADER); + CHECK (!header.header); + CHECK (lumiera_error() == LUMIERA_ERROR_FILEHEADER_HEADER); lumiera_fileheader_close (&header, LUMIERA_FILEHEADER_FLAG_CLEAN); } @@ -114,8 +114,8 @@ TEST (acquire_basic) sizeof (lumiera_fileheader), LUMIERA_FILEHEADER_FLAG_CLEAN, LUMIERA_FILEHEADER_FLAG_CLEAN); - CHECK(header.header); - CHECK(!lumiera_error()); + CHECK (header.header); + CHECK (!lumiera_error()); CHECK (lumiera_fileheader_version (&header) == 0); @@ -141,8 +141,8 @@ TEST (acquire_basic_readonly) sizeof (lumiera_fileheader), LUMIERA_FILEHEADER_FLAG_CLEAN, NULL); - CHECK(header.header); - CHECK(!lumiera_error()); + CHECK (header.header); + CHECK (!lumiera_error()); CHECK (lumiera_fileheader_version (&header) == 0); diff --git a/tests/backend/thread-wrapper-self-recognition-test.cpp b/tests/backend/thread-wrapper-self-recognition-test.cpp index e89fa1601..5816440aa 100644 --- a/tests/backend/thread-wrapper-self-recognition-test.cpp +++ b/tests/backend/thread-wrapper-self-recognition-test.cpp @@ -34,7 +34,6 @@ using test::Test; namespace backend { namespace test { - using lumiera::error::LUMIERA_ERROR_LOGIC; namespace { class TestThread diff --git a/tests/basics/dependency-configuration-test.cpp b/tests/basics/dependency-configuration-test.cpp index 12d595f2a..a3d450575 100644 --- a/tests/basics/dependency-configuration-test.cpp +++ b/tests/basics/dependency-configuration-test.cpp @@ -72,8 +72,8 @@ namespace test{ }; } - using error::LUMIERA_ERROR_LIFECYCLE; - using error::LUMIERA_ERROR_FATAL; + using error::LERR_(LIFECYCLE); + using error::LERR_(FATAL); diff --git a/tests/basics/diagnostic-context-test.cpp b/tests/basics/diagnostic-context-test.cpp index 723ad2589..c674b10b0 100644 --- a/tests/basics/diagnostic-context-test.cpp +++ b/tests/basics/diagnostic-context-test.cpp @@ -56,7 +56,7 @@ namespace test{ } // (End) test setup.... using backend::ThreadJoinable; - using error::LUMIERA_ERROR_LOGIC; + using error::LERR_(LOGIC); using std::rand; diff --git a/tests/basics/singleton-subclass-test.cpp b/tests/basics/singleton-subclass-test.cpp index bb4afa389..8726dfff3 100644 --- a/tests/basics/singleton-subclass-test.cpp +++ b/tests/basics/singleton-subclass-test.cpp @@ -47,7 +47,7 @@ using std::string; namespace lib { namespace test{ - using lumiera::error::LUMIERA_ERROR_LIFECYCLE; + using lumiera::error::LERR_(LIFECYCLE); /** * Target object to be instantiated as Singleton diff --git a/tests/basics/time/digxel-configurations-test.cpp b/tests/basics/time/digxel-configurations-test.cpp index 12d0858a3..ea929d082 100644 --- a/tests/basics/time/digxel-configurations-test.cpp +++ b/tests/basics/time/digxel-configurations-test.cpp @@ -34,7 +34,7 @@ #include -using lumiera::error::LUMIERA_ERROR_ASSERTION; +using lumiera::error::LERR_(ASSERTION); using util::isSameObject; using util::typeStr; using std::rand; diff --git a/tests/basics/time/time-control-test.cpp b/tests/basics/time/time-control-test.cpp index c5be1358e..08f264785 100644 --- a/tests/basics/time/time-control-test.cpp +++ b/tests/basics/time/time-control-test.cpp @@ -57,7 +57,7 @@ namespace test{ using proc::asset::meta::TimeGrid; using lib::meta::Types; using lib::meta::InstantiateChainedCombinations; - using error::LUMIERA_ERROR_UNCONNECTED; + using error::LERR_(UNCONNECTED); diff --git a/tests/basics/time/time-parsing-test.cpp b/tests/basics/time/time-parsing-test.cpp index 499b4efd5..61a77978e 100644 --- a/tests/basics/time/time-parsing-test.cpp +++ b/tests/basics/time/time-parsing-test.cpp @@ -42,7 +42,7 @@ namespace time{ namespace test{ using proc::asset::meta::TimeGrid; - using format::LUMIERA_ERROR_INVALID_TIMECODE; + using format::LERR_(INVALID_TIMECODE); namespace { // Helper for writing test cases diff --git a/tests/basics/time/time-value-test.cpp b/tests/basics/time/time-value-test.cpp index bf9b1a13e..48077d80f 100644 --- a/tests/basics/time/time-value-test.cpp +++ b/tests/basics/time/time-value-test.cpp @@ -38,7 +38,7 @@ using boost::lexical_cast; using util::isnil; using std::string; -using lumiera::error::LUMIERA_ERROR_BOTTOM_VALUE; +using lumiera::error::LERR_(BOTTOM_VALUE); namespace lib { namespace time{ diff --git a/tests/core/application/subsystem-runner-test.cpp b/tests/core/application/subsystem-runner-test.cpp index 84678420a..90a487584 100644 --- a/tests/core/application/subsystem-runner-test.cpp +++ b/tests/core/application/subsystem-runner-test.cpp @@ -80,8 +80,8 @@ namespace test { /** marker for simulated failure exceptions */ LUMIERA_ERROR_DEFINE( TEST, "simulated failure."); - using error::LUMIERA_ERROR_LOGIC; - using error::LUMIERA_ERROR_STATE; + using error::LERR_(LOGIC); + using error::LERR_(STATE); @@ -137,7 +137,7 @@ namespace test { return true; else if ("throw"==startSpec) //---starting flounders - throw error::Fatal("simulated failure to start the subsystem", LUMIERA_ERROR_TEST); + throw error::Fatal("simulated failure to start the subsystem", LERR_(TEST)); return started_; } @@ -200,7 +200,7 @@ namespace test { if ("true" ==runSpec) termination(0); // signal regular termination if ("throw"==runSpec) { - Error problemIndicator("simulated Problem terminating subsystem",LUMIERA_ERROR_TEST); + Error problemIndicator("simulated Problem terminating subsystem",LERR_(TEST)); lumiera_error(); // reset error state.... // Note: in real life this actually // would be an catched exception! diff --git a/tests/core/proc/asset/entry-id-test.cpp b/tests/core/proc/asset/entry-id-test.cpp index 516253de8..8e6b35667 100644 --- a/tests/core/proc/asset/entry-id-test.cpp +++ b/tests/core/proc/asset/entry-id-test.cpp @@ -54,7 +54,7 @@ namespace lib { namespace idi { namespace test{ - using lumiera::error::LUMIERA_ERROR_WRONG_TYPE; + using lumiera::error::LERR_(WRONG_TYPE); namespace { // Test definitions... diff --git a/tests/core/proc/control/command-instance-manager-test.cpp b/tests/core/proc/control/command-instance-manager-test.cpp index c68c41550..c166c71c6 100644 --- a/tests/core/proc/control/command-instance-manager-test.cpp +++ b/tests/core/proc/control/command-instance-manager-test.cpp @@ -50,7 +50,7 @@ namespace test { using std::move; using std::rand; - using lumiera::error::LUMIERA_ERROR_LIFECYCLE; + using lumiera::error::LERR_(LIFECYCLE); diff --git a/tests/core/proc/control/command-use2-test.cpp b/tests/core/proc/control/command-use2-test.cpp index b2b07edf1..8c6b490ad 100644 --- a/tests/core/proc/control/command-use2-test.cpp +++ b/tests/core/proc/control/command-use2-test.cpp @@ -62,7 +62,7 @@ namespace test { using util::contains; - using lumiera::error::LUMIERA_ERROR_EXTERNAL; + using lumiera::error::LERR_(EXTERNAL); /** diagnostics: checks if the given value has been written diff --git a/tests/core/proc/engine/buffer-metadata-key-test.cpp b/tests/core/proc/engine/buffer-metadata-key-test.cpp index 69479057c..6aaa06bb8 100644 --- a/tests/core/proc/engine/buffer-metadata-key-test.cpp +++ b/tests/core/proc/engine/buffer-metadata-key-test.cpp @@ -44,8 +44,8 @@ namespace metadata{ namespace test { - using lumiera::error::LUMIERA_ERROR_INVALID; - using lumiera::error::LUMIERA_ERROR_LIFECYCLE; + using lumiera::error::LERR_(INVALID); + using lumiera::error::LERR_(LIFECYCLE); namespace { // Test fixture diff --git a/tests/core/proc/engine/buffer-metadata-test.cpp b/tests/core/proc/engine/buffer-metadata-test.cpp index 3888358a5..3b72951dc 100644 --- a/tests/core/proc/engine/buffer-metadata-test.cpp +++ b/tests/core/proc/engine/buffer-metadata-test.cpp @@ -47,9 +47,9 @@ namespace proc { namespace engine{ namespace test { - using lumiera::error::LUMIERA_ERROR_FATAL; - using lumiera::error::LUMIERA_ERROR_INVALID; - using lumiera::error::LUMIERA_ERROR_LIFECYCLE; + using lumiera::error::LERR_(FATAL); + using lumiera::error::LERR_(INVALID); + using lumiera::error::LERR_(LIFECYCLE); namespace { // Test fixture diff --git a/tests/core/proc/engine/buffer-provider-protocol-test.cpp b/tests/core/proc/engine/buffer-provider-protocol-test.cpp index 0c269aba5..66cb1313c 100644 --- a/tests/core/proc/engine/buffer-provider-protocol-test.cpp +++ b/tests/core/proc/engine/buffer-provider-protocol-test.cpp @@ -46,8 +46,8 @@ namespace test { using lib::test::Dummy; using proc::engine::BuffHandle; - using error::LUMIERA_ERROR_LOGIC; - using error::LUMIERA_ERROR_LIFECYCLE; + using error::LERR_(LOGIC); + using error::LERR_(LIFECYCLE); namespace { // Test fixture diff --git a/tests/core/proc/mobject/session/query-focus-stack-test.cpp b/tests/core/proc/mobject/session/query-focus-stack-test.cpp index a98280ffa..a45b855a1 100644 --- a/tests/core/proc/mobject/session/query-focus-stack-test.cpp +++ b/tests/core/proc/mobject/session/query-focus-stack-test.cpp @@ -42,7 +42,7 @@ namespace test { using util::isnil; using util::isSameObject; - using lumiera::error::LUMIERA_ERROR_INVALID; + using lumiera::error::LERR_(INVALID); /***********************************************************************//** diff --git a/tests/core/proc/mobject/session/scope-path-test.cpp b/tests/core/proc/mobject/session/scope-path-test.cpp index 18e760999..4487aa679 100644 --- a/tests/core/proc/mobject/session/scope-path-test.cpp +++ b/tests/core/proc/mobject/session/scope-path-test.cpp @@ -46,8 +46,8 @@ namespace test { using util::isnil; using util::isSameObject; - using lumiera::error::LUMIERA_ERROR_LOGIC; - using lumiera::error::LUMIERA_ERROR_INVALID; + using lumiera::error::LERR_(LOGIC); + using lumiera::error::LERR_(INVALID); diff --git a/tests/gui/abstract-tangible-test.cpp b/tests/gui/abstract-tangible-test.cpp index 4e0494ce3..fdd077f52 100644 --- a/tests/gui/abstract-tangible-test.cpp +++ b/tests/gui/abstract-tangible-test.cpp @@ -84,7 +84,7 @@ namespace gui { namespace model{ namespace test { - using lumiera::error::LUMIERA_ERROR_WRONG_TYPE; + using lumiera::error::LERR_(WRONG_TYPE); using ID = lib::idi::BareEntryID const&; namespace { // test fixture... diff --git a/tests/gui/interact/ui-coord-resolver-test.cpp b/tests/gui/interact/ui-coord-resolver-test.cpp index 852b314d1..67b937b0e 100644 --- a/tests/gui/interact/ui-coord-resolver-test.cpp +++ b/tests/gui/interact/ui-coord-resolver-test.cpp @@ -50,8 +50,8 @@ namespace gui { namespace interact { namespace test { - using lumiera::error::LUMIERA_ERROR_INVALID; - using lumiera::error::LUMIERA_ERROR_STATE; + using lumiera::error::LERR_(INVALID); + using lumiera::error::LERR_(STATE); diff --git a/tests/gui/interact/ui-coord-test.cpp b/tests/gui/interact/ui-coord-test.cpp index 69cd2fda8..3f8908403 100644 --- a/tests/gui/interact/ui-coord-test.cpp +++ b/tests/gui/interact/ui-coord-test.cpp @@ -45,8 +45,8 @@ namespace gui { namespace interact { namespace test { - using lumiera::error::LUMIERA_ERROR_INDEX_BOUNDS; - using lumiera::error::LUMIERA_ERROR_LOGIC; + using lumiera::error::LERR_(INDEX_BOUNDS); + using lumiera::error::LERR_(LOGIC); diff --git a/tests/library/diff/gen-node-basic-test.cpp b/tests/library/diff/gen-node-basic-test.cpp index 0608db467..2b73c72f8 100644 --- a/tests/library/diff/gen-node-basic-test.cpp +++ b/tests/library/diff/gen-node-basic-test.cpp @@ -52,8 +52,8 @@ namespace lib { namespace diff{ namespace test{ - using error::LUMIERA_ERROR_WRONG_TYPE; - using error::LUMIERA_ERROR_BOTTOM_VALUE; + using error::LERR_(WRONG_TYPE); + using error::LERR_(BOTTOM_VALUE); namespace {//Test fixture.... diff --git a/tests/library/diff/generic-record-representation-test.cpp b/tests/library/diff/generic-record-representation-test.cpp index 1bd5c6328..02f8ddc6a 100644 --- a/tests/library/diff/generic-record-representation-test.cpp +++ b/tests/library/diff/generic-record-representation-test.cpp @@ -47,9 +47,9 @@ namespace lib { namespace diff{ namespace test{ - using lumiera::error::LUMIERA_ERROR_INVALID; - using lumiera::error::LUMIERA_ERROR_INDEX_BOUNDS; - using lumiera::error::LUMIERA_ERROR_BOTTOM_VALUE; + using lumiera::error::LERR_(INVALID); + using lumiera::error::LERR_(INDEX_BOUNDS); + using lumiera::error::LERR_(BOTTOM_VALUE); namespace {//Test fixture.... diff --git a/tests/library/diff/mutation-message-test.cpp b/tests/library/diff/mutation-message-test.cpp index 209b55e0d..6cd9a59cb 100644 --- a/tests/library/diff/mutation-message-test.cpp +++ b/tests/library/diff/mutation-message-test.cpp @@ -37,7 +37,7 @@ #include #include -using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; +using lumiera::error::LERR_(ITER_EXHAUST); using lib::iter_stl::IterSnapshot; using lib::iter_stl::snapshot; using lib::time::Time; diff --git a/tests/library/diff/tree-mutator-binding-test.cpp b/tests/library/diff/tree-mutator-binding-test.cpp index 56df7c00e..8059810b8 100644 --- a/tests/library/diff/tree-mutator-binding-test.cpp +++ b/tests/library/diff/tree-mutator-binding-test.cpp @@ -55,7 +55,7 @@ namespace lib { namespace diff{ namespace test{ - using lumiera::error::LUMIERA_ERROR_LOGIC; + using lumiera::error::LERR_(LOGIC); namespace {//Test fixture.... diff --git a/tests/library/iter-adapter-test.cpp b/tests/library/iter-adapter-test.cpp index 4cd232fdf..89b20101e 100644 --- a/tests/library/iter-adapter-test.cpp +++ b/tests/library/iter-adapter-test.cpp @@ -44,7 +44,7 @@ namespace lib { namespace test{ using ::Test; - using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; + using lumiera::error::LERR_(ITER_EXHAUST); using boost::lexical_cast; using util::for_each; using util::isnil; diff --git a/tests/library/iter-cursor-test.cpp b/tests/library/iter-cursor-test.cpp index 64a1604b7..ef3b19195 100644 --- a/tests/library/iter-cursor-test.cpp +++ b/tests/library/iter-cursor-test.cpp @@ -44,7 +44,7 @@ namespace test{ using util::isnil; using std::vector; - using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; + using lumiera::error::LERR_(ITER_EXHAUST); namespace { // test fixture diff --git a/tests/library/iter-explorer-test.cpp b/tests/library/iter-explorer-test.cpp index f53537e61..453a84076 100644 --- a/tests/library/iter-explorer-test.cpp +++ b/tests/library/iter-explorer-test.cpp @@ -76,7 +76,7 @@ namespace test{ using util::isSameObject; using lib::iter_stl::eachElm; using lib::iter_explorer::ChainedIters; - using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; + using lumiera::error::LERR_(ITER_EXHAUST); using std::string; diff --git a/tests/library/iter-queue-test.cpp b/tests/library/iter-queue-test.cpp index 1000fe573..52476dda8 100644 --- a/tests/library/iter-queue-test.cpp +++ b/tests/library/iter-queue-test.cpp @@ -39,7 +39,7 @@ namespace test{ using ::Test; using util::isnil; - using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; + using lumiera::error::LERR_(ITER_EXHAUST); diff --git a/tests/library/iter-source-test.cpp b/tests/library/iter-source-test.cpp index b34890cf5..c800a6370 100644 --- a/tests/library/iter-source-test.cpp +++ b/tests/library/iter-source-test.cpp @@ -58,7 +58,7 @@ namespace test{ using std::list; using std::rand; - using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; + using lumiera::error::LERR_(ITER_EXHAUST); using iter_source::eachEntry; using iter_source::transform; diff --git a/tests/library/iter-stack-test.cpp b/tests/library/iter-stack-test.cpp index 3be69c5c8..2457bcee2 100644 --- a/tests/library/iter-stack-test.cpp +++ b/tests/library/iter-stack-test.cpp @@ -39,7 +39,7 @@ namespace test{ using ::Test; using util::isnil; - using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; + using lumiera::error::LERR_(ITER_EXHAUST); diff --git a/tests/library/iter-tree-explorer-test.cpp b/tests/library/iter-tree-explorer-test.cpp index 0b5a4d9aa..3425789c6 100644 --- a/tests/library/iter-tree-explorer-test.cpp +++ b/tests/library/iter-tree-explorer-test.cpp @@ -80,7 +80,7 @@ namespace test{ using util::isnil; using util::isSameObject; using lib::iter_stl::eachElm; - using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; + using lumiera::error::LERR_(ITER_EXHAUST); using std::vector; using std::string; diff --git a/tests/library/itertools-test.cpp b/tests/library/itertools-test.cpp index c3025c496..7ff57e79a 100644 --- a/tests/library/itertools-test.cpp +++ b/tests/library/itertools-test.cpp @@ -50,7 +50,7 @@ namespace test{ using std::vector; using std::rand; - using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; + using lumiera::error::LERR_(ITER_EXHAUST); diff --git a/tests/library/linked-elements-test.cpp b/tests/library/linked-elements-test.cpp index 2a9101528..15820c0aa 100644 --- a/tests/library/linked-elements-test.cpp +++ b/tests/library/linked-elements-test.cpp @@ -46,7 +46,7 @@ namespace test{ using util::isnil; using util::isSameObject; - using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; + using lumiera::error::LERR_(ITER_EXHAUST); namespace { // test data... @@ -80,7 +80,7 @@ namespace test{ , next(0) { if (i == exception_trigger) - throw error::Fatal("simulated error", LUMIERA_ERROR_PROVOKED_FAILURE); + throw error::Fatal("simulated error", LERR_(PROVOKED_FAILURE)); } }; diff --git a/tests/library/meta/access-casted-test.cpp b/tests/library/meta/access-casted-test.cpp index e6ad2f55a..f641bda40 100644 --- a/tests/library/meta/access-casted-test.cpp +++ b/tests/library/meta/access-casted-test.cpp @@ -41,8 +41,8 @@ using std::ostream; using util::isSameObject; -using lumiera::error::LUMIERA_ERROR_BOTTOM_VALUE; -using lumiera::error::LUMIERA_ERROR_WRONG_TYPE; +using lumiera::error::LERR_(BOTTOM_VALUE); +using lumiera::error::LERR_(WRONG_TYPE); namespace util { diff --git a/tests/library/meta/tuple-record-init-test.cpp b/tests/library/meta/tuple-record-init-test.cpp index 7a53c733a..48b075314 100644 --- a/tests/library/meta/tuple-record-init-test.cpp +++ b/tests/library/meta/tuple-record-init-test.cpp @@ -47,7 +47,7 @@ using lib::time::Duration; using lib::time::Time; using lib::hash::LuidH; -using lumiera::error::LUMIERA_ERROR_WRONG_TYPE; +using lumiera::error::LERR_(WRONG_TYPE); using std::string; using std::tuple; diff --git a/tests/library/meta/virtual-copy-support-test.cpp b/tests/library/meta/virtual-copy-support-test.cpp index 544020262..2ab0a898c 100644 --- a/tests/library/meta/virtual-copy-support-test.cpp +++ b/tests/library/meta/virtual-copy-support-test.cpp @@ -41,8 +41,8 @@ using util::_Fmt; using util::isnil; using std::string; -using lumiera::error::LUMIERA_ERROR_LOGIC; -using lumiera::error::LUMIERA_ERROR_WRONG_TYPE; +using lumiera::error::LERR_(LOGIC); +using lumiera::error::LERR_(WRONG_TYPE); namespace lib { @@ -222,7 +222,7 @@ namespace test { if (!impl) throw error::Logic("virtual copy works only on instances " "of the same concrete implementation class" - ,error::LUMIERA_ERROR_WRONG_TYPE); + ,error::LERR_(WRONG_TYPE)); else return *impl; } diff --git a/tests/library/multifact-singleton-test.cpp b/tests/library/multifact-singleton-test.cpp index bf087ab23..44a825a64 100644 --- a/tests/library/multifact-singleton-test.cpp +++ b/tests/library/multifact-singleton-test.cpp @@ -46,7 +46,7 @@ namespace test{ using std::ostream; using std::string; - using lumiera::error::LUMIERA_ERROR_INVALID; + using lumiera::error::LERR_(INVALID); namespace { // hierarchy of test dummy objects diff --git a/tests/library/opaque-holder-test.cpp b/tests/library/opaque-holder-test.cpp index 2b048d294..2d6c414bf 100644 --- a/tests/library/opaque-holder-test.cpp +++ b/tests/library/opaque-holder-test.cpp @@ -43,9 +43,9 @@ namespace test{ using util::isnil; using util::for_each; using util::isSameObject; - using error::LUMIERA_ERROR_BOTTOM_VALUE; - using error::LUMIERA_ERROR_WRONG_TYPE; - using error::LUMIERA_ERROR_ASSERTION; + using error::LERR_(BOTTOM_VALUE); + using error::LERR_(WRONG_TYPE); + using error::LERR_(ASSERTION); using std::vector; using std::cout; diff --git a/tests/library/path-array-test.cpp b/tests/library/path-array-test.cpp index a4bbb9bd9..5656efb09 100644 --- a/tests/library/path-array-test.cpp +++ b/tests/library/path-array-test.cpp @@ -44,8 +44,8 @@ using util::join; namespace lib { namespace test { - using lumiera::error::LUMIERA_ERROR_INDEX_BOUNDS; - using lumiera::error::LUMIERA_ERROR_INVALID; + using lumiera::error::LERR_(INDEX_BOUNDS); + using lumiera::error::LERR_(INVALID); using ParrT = lib::PathArray<5>; diff --git a/tests/library/scoped-collection-test.cpp b/tests/library/scoped-collection-test.cpp index 1473d4b90..48947ee7d 100644 --- a/tests/library/scoped-collection-test.cpp +++ b/tests/library/scoped-collection-test.cpp @@ -91,7 +91,7 @@ namespace test{ using util::isnil; - using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST; + using lumiera::error::LERR_(ITER_EXHAUST); typedef ScopedCollection CollD;