Proper exception rethrowing in UtilityAI
This commit is contained in:
parent
0c68f2973e
commit
c1b247ff22
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue