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; }
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); } }
public UncleanStatusException(int statusCode) : base($"Code: {statusCode} Message: {HALLowLevel.GetErrorMessage(statusCode)}") { StatusCode = statusCode; }