From 09eaca01447586e7eb6c6dc2424a2f81eea51c4c Mon Sep 17 00:00:00 2001 From: Bepis <36346617+bbepis@users.noreply.github.com> Date: Sun, 1 Apr 2018 02:15:27 +1000 Subject: [PATCH] Add a custom missing dependency exception --- BepInEx/TypeLoader.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/BepInEx/TypeLoader.cs b/BepInEx/TypeLoader.cs index 9e366da..68fba5c 100644 --- a/BepInEx/TypeLoader.cs +++ b/BepInEx/TypeLoader.cs @@ -72,7 +72,7 @@ namespace BepInEx Type dependencyType = AllPlugins.FirstOrDefault(x => GetMetadata(x)?.GUID == dependency.refGUID); if (dependencyType == null) - throw new Exception("Cannot find dependency type."); + throw new MissingDependencyException("Cannot find dependency type."); dependencyTypes.Add(dependencyType); } @@ -80,4 +80,17 @@ namespace BepInEx return dependencyTypes; } } + + public class MissingDependencyException : Exception + { + public MissingDependencyException() : base() + { + + } + + public MissingDependencyException(string message) : base(message) + { + + } + } }