From e14916f9622592a993fad54fe184a03de0b95c7b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 11 May 2022 17:12:58 -0400 Subject: add error code to SContentLoadException --- src/SMAPI/Framework/Exceptions/SContentLoadException.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/SMAPI/Framework/Exceptions/SContentLoadException.cs') diff --git a/src/SMAPI/Framework/Exceptions/SContentLoadException.cs b/src/SMAPI/Framework/Exceptions/SContentLoadException.cs index be1fe748..4db24d06 100644 --- a/src/SMAPI/Framework/Exceptions/SContentLoadException.cs +++ b/src/SMAPI/Framework/Exceptions/SContentLoadException.cs @@ -6,13 +6,24 @@ namespace StardewModdingAPI.Framework.Exceptions /// An implementation of used by SMAPI to detect whether it was thrown by SMAPI or the underlying framework. internal class SContentLoadException : ContentLoadException { + /********* + ** Accessors + *********/ + /// Why loading the asset through the content pipeline failed. + public ContentLoadErrorType ErrorType { get; } + + /********* ** Public methods *********/ /// Construct an instance. + /// Why loading the asset through the content pipeline failed. /// The error message. /// The underlying exception, if any. - public SContentLoadException(string message, Exception? ex = null) - : base(message, ex) { } + public SContentLoadException(ContentLoadErrorType errorType, string message, Exception? ex = null) + : base(message, ex) + { + this.ErrorType = errorType; + } } } -- cgit