From 5ab26a427b06c2b073be9f572e7fa9ad0f7b2270 Mon Sep 17 00:00:00 2001 From: caneleex Date: Tue, 4 Oct 2022 20:43:29 +0200 Subject: [PATCH] fix(youtube/sponsorblock): parse the error response on code 400 (#169) --- .../integrations/sponsorblock/requests/SBRequester.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/revanced/integrations/sponsorblock/requests/SBRequester.java b/app/src/main/java/app/revanced/integrations/sponsorblock/requests/SBRequester.java index 67068c2e..4ec89fae 100644 --- a/app/src/main/java/app/revanced/integrations/sponsorblock/requests/SBRequester.java +++ b/app/src/main/java/app/revanced/integrations/sponsorblock/requests/SBRequester.java @@ -102,7 +102,7 @@ public class SBRequester { SponsorBlockUtils.messageToToast = str("submit_failed_rate_limit"); break; case 400: - SponsorBlockUtils.messageToToast = str("submit_failed_invalid", connection.getErrorStream()); + SponsorBlockUtils.messageToToast = str("submit_failed_invalid", Requester.parseErrorJson(connection)); break; default: SponsorBlockUtils.messageToToast = str("submit_failed_unknown_error", responseCode, connection.getResponseMessage()); @@ -222,4 +222,4 @@ public class SBRequester { private static JSONObject getJSONObject(Route route, String... params) throws Exception { return Requester.getJSONObject(getConnectionFromRoute(route, params)); } -} \ No newline at end of file +}