mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-11-29 08:55:48 +00:00
Silence unchecked error
This commit is contained in:
1 parent
fca4d7459c
commit
ba2214d8c7
1 file changed
+3
-2
@@ -160,9 +160,10 @@ public class Utils {
|
||||
return NetworkResultUtil.toBasicLegacy(response);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T, E extends BadRequestError> T handleResponseException(final RequestResult<T, E> result) throws IOException {
|
||||
if (result instanceof RequestResult.Success) {
|
||||
return ((RequestResult.Success<T>) result).getResult();
|
||||
if (result instanceof RequestResult.Success<?> success) {
|
||||
return ((RequestResult.Success<T>) success).getResult();
|
||||
} else if (result instanceof RequestResult.ApplicationError e) {
|
||||
final var cause = e.getCause();
|
||||
switch (cause) {
|
||||
|
||||
Reference in new issue
Block a user