IPS-157 Revert "No need for isErrorStatusCode"

This reverts commit 4bf16abe2e.
IPS-157
Dirk Zimmermann 1 year ago
parent 4bf16abe2e
commit 530a6d22f3

@ -17,6 +17,11 @@ NS_ASSUME_NONNULL_BEGIN
/// @retun The severity octet of the given status code.
+ (NSUInteger)severityFromStatusCode:(PEPTransportStatusCode)statusCode;
/// Is the given status code an error?
/// @note A transport emitting this is supposed to "heal itself".
/// @return `YES` if the given status code is an error, `NO` if it isn't.
+ (BOOL)isErrorStatusCode:(PEPTransportStatusCode)statusCode;
/// Is the given status code a critical error?
/// @note A transport emitting this is _not_ supposed to be able to "heal itself".
/// @return `YES` if the given status code is a critical error, `NO` if it isn't.

@ -13,6 +13,10 @@
return (statusCode >> 16) & 0xff;
}
+ (BOOL)isErrorStatusCode:(PEPTransportStatusCode)statusCode {
return [self severityFromStatusCode:statusCode] == 0x80;
}
+ (BOOL)isCriticalErrorStatusCode:(PEPTransportStatusCode)statusCode {
return [self severityFromStatusCode:statusCode] == 0xff;
}

Loading…
Cancel
Save