From a81490c35ca93174265f18d98a542d383a11bdfa Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:39:23 +1000 Subject: reduce some Directives exceptions down to error strings for perf additionally, image operations that don't exist simply pass through now --- source/base/StarAssets.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/base/StarAssets.cpp') diff --git a/source/base/StarAssets.cpp b/source/base/StarAssets.cpp index f2582b1..18435e9 100644 --- a/source/base/StarAssets.cpp +++ b/source/base/StarAssets.cpp @@ -1160,7 +1160,10 @@ shared_ptr Assets::loadImage(AssetPath const& path) const { Image newImage = *source->image; path.directives.forEach([&](auto const& entry, Directives const&) { if (auto error = entry.operation.template ptr()) - std::rethrow_exception(error->exception); + if (auto string = error->cause.ptr()) + throw DirectivesException::format("ImageOperation parse error: {}", *string); + else + std::rethrow_exception(error->cause.get()); else processImageOperation(entry.operation, newImage, [&](String const& ref) { return references.get(ref).get(); }); }); -- cgit v1.2.3