private ResponseStatus GetResponseStatus(short code, ErrorMap errorMap) { var status = (ResponseStatus)code; // Is it a known response status? if (Enum.IsDefined(typeof(ResponseStatus), status)) { return(status); } // If available, try and use the error map to get more details if (errorMap != null && errorMap.TryGetGetErrorCode(code, out ErrorCode)) { return(ResponseStatus.Failure); } return(ResponseStatus.UnknownError); }
internal static ResponseStatus GetResponseStatus(short code, ErrorMap errorMap, out ErrorCode errorCode) { var status = (ResponseStatus)code; // Is it a known response status? if (!Enum.IsDefined(typeof(ResponseStatus), status)) { status = ResponseStatus.UnknownError; } // If available, try and use the error map to get more details if (errorMap != null) { errorMap.TryGetGetErrorCode(code, out errorCode); } else { errorCode = null;//make the compiler happy } return(status); }