small change

This commit is contained in:
2021-12-08 18:59:54 +01:00
parent 0aee7aa701
commit e6e09f5695

View File

@ -19,12 +19,7 @@ namespace NAMESPACEPLACEHOLDER.Client {
}
public static ExceptionFactory ExtExceptionFactory = (methodName, response) => {
var status = (int) response.StatusCode;
if (status >= 400) {
var ero = JsonConvert.DeserializeObject<ErrorResultObject>(response.RawContent);
return new ExtApiException(ero);
}
return null;
return (((int)response.StatusCode) >= 400) ? new ExtApiException(JsonConvert.DeserializeObject<ErrorResultObject>(response.RawContent)) : null;
};
}
}