Ejemplo n.º 1
0
        private static string GetMessage(CommandCompletionStatus status)
        {
            switch (status)
            {
            case CommandCompletionStatus.Canceled:
                return("Command canceled");

            case CommandCompletionStatus.Rejected:
                return("Command rejected");
            }

            return("Command failed");
        }
Ejemplo n.º 2
0
        private static string GetMessage(CommandCompletionStatus status)
        {
            switch (status)
            {
                case CommandCompletionStatus.Canceled:
                    return "Command canceled";

                case CommandCompletionStatus.Rejected:
                    return "Command rejected";
            }

            return "Command failed";
        }
Ejemplo n.º 3
0
 internal CommandFailedException(Exception cause, CommandCompletionStatus status) : base(GetMessage(status), cause)
 {
     IsFallbackImplemented = true; // Assume the best! Actually, we'll just set it to false later if we don't have an implementation.
     Status = status;
 }
Ejemplo n.º 4
0
 protected CommandFailedException(string message, Exception cause, CommandCompletionStatus status) : base(message, cause)
 {
     IsFallbackImplemented = true; // Assume the best! Actually, we'll just set it to false later if we don't have an implementation.
     Status = status;
 }
Ejemplo n.º 5
0
 private static void AttachCommandExceptionData(BaseCommand command, Exception exception, CommandCompletionStatus status, InformativeCancellationToken ct)
 {
     // Use namespaced keys here to avoid clobbering data that the application might've
     // already attached (or will attach later).
     exception.Data["MjolnirCommand"] = command.Name;
     exception.Data["MjolnirStatus"] = status;
     exception.Data["MjolnirBreaker"] = command.BreakerKey.Name;
     exception.Data["MjolnirBulkhead"] = command.BulkheadKey.Name;
     exception.Data["MjolnirTimeoutMillis"] = ct.DescriptionForLog;
     exception.Data["MjolnirExecuteMillis"] = command.ExecutionTimeMillis;
 }