Example #1
0
 public AllocationException(int statusCode, int requested, int min, int max)
     : base(statusCode, $"Code: {statusCode} Message: {HALLowLevel.GetErrorMessage(statusCode)}: min {min} max {max} requested {requested}")
 {
     Requested = requested;
     Min       = min;
     Max       = max;
 }
Example #2
0
 public static void StatusCheck(int status)
 {
     if (status < 0)
     {
         if (status == HalHandleErrorCode)
         {
             throw new HalHandleException(status);
         }
         throw new UncleanStatusException(status);
     }
     else if (status > 0)
     {
         var message    = HALLowLevel.GetErrorMessage(status);
         var stackTrace = Environment.StackTrace;
         DriverStationLowLevel.SendError(true, status, false, message.AsSpan(), "".AsSpan(), stackTrace.AsSpan(), true);
     }
 }
Example #3
0
 public UncleanStatusException(int statusCode) : base($"Code: {statusCode} Message: {HALLowLevel.GetErrorMessage(statusCode)}")
 {
     StatusCode = statusCode;
 }