added some error handling
This commit is contained in:
parent
47f2be13e5
commit
3c5905bb4e
File diff suppressed because one or more lines are too long
3
index.js
3
index.js
|
@ -111,6 +111,9 @@ async function track(id, format, access_token, tagging) {
|
||||||
return new Response(null, {status: 302, headers: {'location': result}})
|
return new Response(null, {status: 302, headers: {'location': result}})
|
||||||
} else {
|
} else {
|
||||||
const track = await fetch(result)
|
const track = await fetch(result)
|
||||||
|
if (track.status !== 200) {
|
||||||
|
return new Response("Couldn't get track stream", {status: 403, headers: {'content-type': 'text/plain'}})
|
||||||
|
}
|
||||||
|
|
||||||
const id3 = new ID3Writer(Buffer.alloc(0));
|
const id3 = new ID3Writer(Buffer.alloc(0));
|
||||||
id3.padding = 0
|
id3.padding = 0
|
||||||
|
|
Loading…
Reference in New Issue