-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
619 changed files
with
57,242 additions
and
26,050 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
Mutagen.Bethesda.Core/Exceptions/MissingRecordException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Mutagen.Bethesda | ||
{ | ||
public class MissingRecordException : Exception | ||
{ | ||
public FormKey? FormKey { get; } | ||
public string? EditorID { get; } | ||
public Type? Type { get; } | ||
public Type[] Types { get; } = Array.Empty<Type>(); | ||
|
||
public MissingRecordException(FormKey formKey, Type type) | ||
{ | ||
FormKey = formKey; | ||
Type = type; | ||
} | ||
|
||
public MissingRecordException(string editorID, Type type) | ||
{ | ||
EditorID = editorID; | ||
Type = type; | ||
} | ||
|
||
public MissingRecordException(FormKey formKey, Type[] types) | ||
{ | ||
FormKey = formKey; | ||
Type = types.FirstOrDefault(); | ||
Types = types; | ||
} | ||
|
||
public MissingRecordException(string editorID, Type[] types) | ||
{ | ||
EditorID = editorID; | ||
Type = types.FirstOrDefault(); | ||
Types = types; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
if (Types.Length == 0) | ||
{ | ||
if (Type != null) | ||
{ | ||
return $"{nameof(MissingRecordException)} {FormKey?.ToString() ?? EditorID}<{Type}>: {this.Message} {this.InnerException}{this.StackTrace}"; | ||
} | ||
else | ||
{ | ||
return $"{nameof(MissingRecordException)} {FormKey?.ToString() ?? EditorID}: {this.Message} {this.InnerException}{this.StackTrace}"; | ||
} | ||
} | ||
else | ||
{ | ||
return $"{nameof(MissingRecordException)} {FormKey?.ToString() ?? EditorID}<{Type} (+{Types.Length - 1})>: {this.Message} {this.InnerException}{this.StackTrace}"; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.