From 4f2c0342e7d2e60a39cec847ecdf981efcf39b15 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 4 Dec 2022 22:14:52 +0200 Subject: [PATCH] Report which system caused invalid access --- source/game/stage.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/game/stage.cpp b/source/game/stage.cpp index 43446bd..f8dbd1a 100644 --- a/source/game/stage.cpp +++ b/source/game/stage.cpp @@ -1,4 +1,6 @@ #include "stage.h" +#include +#include #include "accessguard.h" #include "camera.h" #include "root.h" @@ -62,7 +64,14 @@ void Stage::tick(Time::TimeDelta dt) for(const auto &s: systems) { System::Activator act(*s); - s->tick(dt); + try + { + s->tick(dt); + } + catch(const invalid_access &exc) + { + throw invalid_access(format("%s by %s", exc.what(), Debug::demangle(typeid(*s).name()))); + } } } -- 2.43.0