LightNode.Server.LightNodeServer.IsRethrowOrEmitException C# (CSharp) Method

IsRethrowOrEmitException() static private method

static private IsRethrowOrEmitException ( IOperationCoordinator coordinator, ILightNodeOptions options, HttpContext httpContext, Exception ex ) : bool
coordinator IOperationCoordinator
options ILightNodeOptions
httpContext HttpContext
ex System.Exception
return bool
        static bool IsRethrowOrEmitException(IOperationCoordinator coordinator, ILightNodeOptions options, HttpContext httpContext, Exception ex)
        {
            var exString = ex.ToString();
            coordinator.OnProcessInterrupt(options, httpContext, InterruptReason.ExecuteFailed, exString);
            switch (options.ErrorHandlingPolicy)
            {
                case ErrorHandlingPolicy.ReturnInternalServerError:
                    httpContext.EmitInternalServerError();
                    httpContext.EmitStringMessage("500 InternalServerError");
                    return false;
                case ErrorHandlingPolicy.ReturnInternalServerErrorIncludeErrorDetails:
                    httpContext.EmitInternalServerError();
                    httpContext.EmitStringMessage(exString);
                    return false;
                case ErrorHandlingPolicy.ThrowException:
                default:
                    httpContext.EmitInternalServerError();
                    return true;
            }
        }
    }

Same methods

LightNodeServer::IsRethrowOrEmitException ( IOperationCoordinator coordinator, ILightNodeOptions options, object>.IDictionary environment, Exception ex ) : bool