-
Notifications
You must be signed in to change notification settings - Fork 0
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
6 changed files
with
130 additions
and
43 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
42 changes: 36 additions & 6 deletions
42
Core/SDKs/CustomScenario/CustomScenarioLoadFromJsonException.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 |
---|---|---|
@@ -1,22 +1,52 @@ | ||
namespace Core.SDKs.CustomScenario; | ||
using PluginCore; | ||
|
||
namespace Core.SDKs.CustomScenario; | ||
|
||
public enum CustomScenarioLoadFromJsonFailedType | ||
{ | ||
插件未找到, | ||
插件未启用, | ||
方法未找到, | ||
类未找到 | ||
} | ||
public class CustomScenarioLoadFromJsonException : Exception | ||
{ | ||
public string PluginName | ||
private string? _pluginName; | ||
public CustomScenarioLoadFromJsonFailedType FailedType { get; set; } | ||
|
||
public string? PluginName | ||
|
||
{ | ||
get; | ||
set; | ||
get | ||
{ | ||
if (_pluginName is null) | ||
return PluginInfo.Name; | ||
return _pluginName; | ||
} | ||
set => _pluginName = value; | ||
} | ||
|
||
public string MethodName | ||
public PluginInfo PluginInfo | ||
{ | ||
get; | ||
set; | ||
} | ||
public string? MethodName | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
public CustomScenarioLoadFromJsonException(string pluginName, string methodName) | ||
public CustomScenarioLoadFromJsonException(CustomScenarioLoadFromJsonFailedType customScenarioLoadFromJsonFailedType,string pluginName, string? methodName) | ||
{ | ||
this.PluginName = pluginName; | ||
this.MethodName = methodName; | ||
this.FailedType = customScenarioLoadFromJsonFailedType; | ||
} | ||
public CustomScenarioLoadFromJsonException(CustomScenarioLoadFromJsonFailedType customScenarioLoadFromJsonFailedType,PluginInfo pluginInfo, string? methodName) | ||
{ | ||
this.PluginInfo = pluginInfo; | ||
this.MethodName = methodName; | ||
this.FailedType = customScenarioLoadFromJsonFailedType; | ||
} | ||
} |
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