summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/InternalExtensions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/InternalExtensions.cs')
-rw-r--r--src/SMAPI/Framework/InternalExtensions.cs35
1 files changed, 3 insertions, 32 deletions
diff --git a/src/SMAPI/Framework/InternalExtensions.cs b/src/SMAPI/Framework/InternalExtensions.cs
index ab7f1e6c..6c9a5f3b 100644
--- a/src/SMAPI/Framework/InternalExtensions.cs
+++ b/src/SMAPI/Framework/InternalExtensions.cs
@@ -14,6 +14,9 @@ namespace StardewModdingAPI.Framework
/// <summary>Provides extension methods for SMAPI's internal use.</summary>
internal static class InternalExtensions
{
+ /*********
+ ** Public methods
+ *********/
/****
** IMonitor
****/
@@ -55,38 +58,6 @@ namespace StardewModdingAPI.Framework
}
/****
- ** Exceptions
- ****/
- /// <summary>Get a string representation of an exception suitable for writing to the error log.</summary>
- /// <param name="exception">The error to summarize.</param>
- public static string GetLogSummary(this Exception exception)
- {
- switch (exception)
- {
- case TypeLoadException ex:
- return $"Failed loading type '{ex.TypeName}': {exception}";
-
- case ReflectionTypeLoadException ex:
- string summary = exception.ToString();
- foreach (Exception childEx in ex.LoaderExceptions)
- summary += $"\n\n{childEx.GetLogSummary()}";
- return summary;
-
- default:
- return exception.ToString();
- }
- }
-
- /// <summary>Get the lowest exception in an exception stack.</summary>
- /// <param name="exception">The exception from which to search.</param>
- public static Exception GetInnermostException(this Exception exception)
- {
- while (exception.InnerException != null)
- exception = exception.InnerException;
- return exception;
- }
-
- /****
** ReaderWriterLockSlim
****/
/// <summary>Run code within a read lock.</summary>