Error handling search
This commit is contained in:
5
main.ts
5
main.ts
@@ -261,6 +261,11 @@ for (const mentalState of mentalStates) {
|
|||||||
authorization: `Bearer ${AUTHTOKEN}`
|
authorization: `Bearer ${AUTHTOKEN}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (!response.ok) {
|
||||||
|
chalk.red("ERROR SEARCHING SONGS")
|
||||||
|
chalk.red(response.text());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const responseData = await response.json();
|
const responseData = await response.json();
|
||||||
const data = formatAudioData(responseData.result);
|
const data = formatAudioData(responseData.result);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user