Refactor error/exception/message handling
This adds: - LuaCsSetup.ExceptionHandler so we can decide how we want to handle exceptions for unit tests - LuaCsSetup.MessageHandler so we can redirect logs to the XUnit output helper
This commit is contained in:
@@ -79,7 +79,7 @@ namespace Barotrauma
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsPathAllowedException(string path, bool write = true, LuaCsSetup.ExceptionType exceptionType = LuaCsSetup.ExceptionType.Both)
|
||||
public static bool IsPathAllowedException(string path, bool write = true, LuaCsMessageOrigin origin = LuaCsMessageOrigin.Unknown)
|
||||
{
|
||||
if (write)
|
||||
{
|
||||
@@ -106,9 +106,9 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
public static bool IsPathAllowedLuaException(string path, bool write = true) =>
|
||||
IsPathAllowedException(path, write, LuaCsSetup.ExceptionType.Lua);
|
||||
IsPathAllowedException(path, write, LuaCsMessageOrigin.LuaMod);
|
||||
public static bool IsPathAllowedCsException(string path, bool write = true) =>
|
||||
IsPathAllowedException(path, write, LuaCsSetup.ExceptionType.CSharp);
|
||||
IsPathAllowedException(path, write, LuaCsMessageOrigin.CSharpMod);
|
||||
|
||||
public static string Read(string path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user