Proper exception rethrowing in UtilityAI
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using System.Threading;
|
||||
using Content.Server.AI.Operators;
|
||||
using Content.Server.AI.Utility.Actions;
|
||||
@@ -137,6 +138,9 @@ namespace Content.Server.AI.Utility.AiLogic
|
||||
break;
|
||||
default:
|
||||
Logger.FatalS("ai", _actionRequest.Exception.ToString());
|
||||
ExceptionDispatchInfo.Capture(_actionRequest.Exception).Throw();
|
||||
// The code never actually reaches here, because the above throws.
|
||||
// This is to tell the compiler that the flow never leaves here.
|
||||
throw _actionRequest.Exception;
|
||||
}
|
||||
var action = _actionRequest.Result;
|
||||
|
||||
Reference in New Issue
Block a user