fix(youtube/sponsorblock): parse the error response on code 400 (#169)

This commit is contained in:
caneleex 2022-10-04 20:43:29 +02:00 committed by GitHub
parent 9255fa30fa
commit 5ab26a427b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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));
}
}
}