From 0aa569d4feecc15d34d22e9d0a57e019630b7060 Mon Sep 17 00:00:00 2001 From: elsid Date: Mon, 22 May 2023 02:54:32 +0200 Subject: [PATCH] Add UniversalId argument type to exception message on invalid access --- apps/opencs/model/world/universalid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/world/universalid.cpp b/apps/opencs/model/world/universalid.cpp index d7a820ad5d..dec533b015 100644 --- a/apps/opencs/model/world/universalid.cpp +++ b/apps/opencs/model/world/universalid.cpp @@ -360,7 +360,7 @@ const std::string& CSMWorld::UniversalId::getId() const if (const std::string* result = std::get_if(&mValue)) return *result; - throw std::logic_error("invalid access to ID of non-ID UniversalId"); + throw std::logic_error("invalid access to ID of " + ::toString(getArgumentType()) + " UniversalId"); } int CSMWorld::UniversalId::getIndex() const @@ -368,7 +368,7 @@ int CSMWorld::UniversalId::getIndex() const if (const int* result = std::get_if(&mValue)) return *result; - throw std::logic_error("invalid access to index of non-index UniversalId"); + throw std::logic_error("invalid access to index of " + ::toString(getArgumentType()) + " UniversalId"); } ESM::RefId CSMWorld::UniversalId::getRefId() const