fix error handling in patches
This commit is contained in:
@@ -266,8 +266,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
if (classType == null)
|
if (classType == null)
|
||||||
{
|
{
|
||||||
GameMain.LuaCs.HandleException(new Exception($"Invalid class name '{className}'."));
|
throw new ArgumentNullException($"Invalid class name '{className}'.");
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MethodInfo methodInfo = null;
|
MethodInfo methodInfo = null;
|
||||||
@@ -285,7 +284,7 @@ namespace Barotrauma
|
|||||||
if (methodInfo == null)
|
if (methodInfo == null)
|
||||||
{
|
{
|
||||||
string parameterNamesStr = parameterNames == null ? "" : string.Join(", ", parameterNames);
|
string parameterNamesStr = parameterNames == null ? "" : string.Join(", ", parameterNames);
|
||||||
GameMain.LuaCs.HandleException(new Exception($"Method '{methodName}' with parameters '{parameterNamesStr}' not found in class '{className}'"));
|
throw new ArgumentNullException($"Method '{methodName}' with parameters '{parameterNamesStr}' not found in class '{className}'");
|
||||||
}
|
}
|
||||||
|
|
||||||
return methodInfo;
|
return methodInfo;
|
||||||
|
|||||||
Reference in New Issue
Block a user