From 6d2d90b7681e4e274e92742e98905ec4000486ca Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 12 Mar 2017 01:31:15 -0500 Subject: add logic to detect incompatible mod instructions & reject mod load (#247) --- .../Framework/IncompatibleInstructionException.cs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/StardewModdingAPI/Framework/IncompatibleInstructionException.cs (limited to 'src/StardewModdingAPI/Framework/IncompatibleInstructionException.cs') diff --git a/src/StardewModdingAPI/Framework/IncompatibleInstructionException.cs b/src/StardewModdingAPI/Framework/IncompatibleInstructionException.cs new file mode 100644 index 00000000..affe2cb3 --- /dev/null +++ b/src/StardewModdingAPI/Framework/IncompatibleInstructionException.cs @@ -0,0 +1,27 @@ +using System; + +namespace StardewModdingAPI.Framework +{ + /// An exception raised when an incompatible instruction is found while loading a mod assembly. + internal class IncompatibleInstructionException : Exception + { + /********* + ** Accessors + *********/ + /// A brief noun phrase which describes the incompatible instruction that was found. + public string NounPhrase { get; } + + + /********* + ** Public methods + *********/ + /// Construct an instance. + /// A brief noun phrase which describes the incompatible instruction that was found. + /// A message which describes the error. + public IncompatibleInstructionException(string nounPhrase, string message) + : base(message) + { + this.NounPhrase = nounPhrase; + } + } +} -- cgit