diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-25 09:39:23 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-25 09:39:23 +1000 |
commit | a81490c35ca93174265f18d98a542d383a11bdfa (patch) | |
tree | 54b75354b8a2273c5c5055c0f0caa9ba88f02e5e /source/base | |
parent | 1b86da7f3634b8bc19473fde10b0a9079b0f4580 (diff) |
reduce some Directives exceptions down to error strings for perf
additionally, image operations that don't exist simply pass through now
Diffstat (limited to 'source/base')
-rw-r--r-- | source/base/StarAssets.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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::AssetData> 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<ErrorImageOperation>()) - std::rethrow_exception(error->exception); + if (auto string = error->cause.ptr<std::string>()) + throw DirectivesException::format("ImageOperation parse error: {}", *string); + else + std::rethrow_exception(error->cause.get<std::exception_ptr>()); else processImageOperation(entry.operation, newImage, [&](String const& ref) { return references.get(ref).get(); }); }); |