From e7c2318a4bfe6cb5afbfd27bcdb441d5afdf29e0 Mon Sep 17 00:00:00 2001 From: arookas Date: Sun, 13 Dec 2015 01:20:26 -0500 Subject: [PATCH] Made better error messages for sunImportException. --- ssc/exceptions.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ssc/exceptions.cs b/ssc/exceptions.cs index 8ee776a..fb7e913 100644 --- a/ssc/exceptions.cs +++ b/ssc/exceptions.cs @@ -37,7 +37,22 @@ namespace arookas { public string Name { get; private set; } public sunImportResult Result { get; private set; } - public override string Message { get { return String.Format("Name: {0}, Result: {1}", Name, Result); } } + public override string Message + { + get + { + string format; + switch (Result) + { + case sunImportResult.Loaded: format = "Script '{0}' loaded successfully."; break; // Error: Success! + case sunImportResult.Skipped: format = "Script '{0}' was skipped."; break; + case sunImportResult.Missing: format = "Script '{0}' could not be found."; break; + case sunImportResult.FailedToLoad: format = "Script '{0}' failed to load."; break; + default: format = "Name: {0}, Result: {1}"; break; + } + return String.Format(format, Name, Result); + } + } public sunImportException(string name, sunImportResult result) {