From 8eff529b9d6c6a4903614db8800076912eccc805 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 27 Sep 2023 18:58:09 +0200 Subject: [PATCH] Fixed various exception types not being wrapped by ContentLoadExceptions when loading raw or JSON content --- CHANGELOG.md | 4 ++++ MLEM.Data/Content/RawContentManager.cs | 2 +- MLEM.Data/ContentExtensions.cs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 680e7df..0183c8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ Improvements - Allow scrolling panels to contain other scrolling panels - Allow dropdowns to have scrolling panels +### MLEM.Data +Fixes +- Fixed various exception types not being wrapped by ContentLoadExceptions when loading raw or JSON content + ## 6.2.0 ### MLEM diff --git a/MLEM.Data/Content/RawContentManager.cs b/MLEM.Data/Content/RawContentManager.cs index 34bb8ab..67aa92e 100644 --- a/MLEM.Data/Content/RawContentManager.cs +++ b/MLEM.Data/Content/RawContentManager.cs @@ -100,7 +100,7 @@ namespace MLEM.Data.Content { r.Name = assetName; return t; } - } catch (FileNotFoundException) {} + } catch (IOException) {} } } throw new ContentLoadException($"Asset {assetName} not found. Tried files {string.Join(", ", triedFiles)}"); diff --git a/MLEM.Data/ContentExtensions.cs b/MLEM.Data/ContentExtensions.cs index 96fce9c..943d94f 100644 --- a/MLEM.Data/ContentExtensions.cs +++ b/MLEM.Data/ContentExtensions.cs @@ -68,7 +68,7 @@ namespace MLEM.Data { using (var reader = new JsonTextReader(stream)) return serializerToUse.Deserialize(reader); } - } catch (FileNotFoundException) {} + } catch (IOException) {} } throw new ContentLoadException($"Asset {name} not found. Tried files {string.Join(", ", triedFiles)}"); }