fix(FormatUtils): Throw an error if download requests fails

This commit is contained in:
슈리튬
2024-06-29 04:45:39 +09:00
committed by GitHub
parent bd9f6ac64c
commit a19511de24

View File

@@ -90,6 +90,10 @@ export async function download(
signal: cancel.signal
});
// Throw if the response is not 2xx
if (!response.ok)
throw new InnertubeError('The server responded with a non 2xx status code', { error_type: 'FETCH_FAILED', response });
const body = response.body;
if (!body)