throw a critical error when youtube api returns a stub

This commit is contained in:
wukko
2023-12-25 12:59:00 +06:00
parent 0014c8b9fb
commit a4349b4c41
4 changed files with 19 additions and 5 deletions

View File

@@ -35,11 +35,13 @@ export function apiJSON(type, obj) {
break;
}
return { status: 200, body: { status: "picker", pickerType: pickerType, picker: obj.picker, audio: audio } };
case 6: // critical error, action should be taken by balancer/other server software
return { status: 500, body: { status: "error", text: obj.t, critical: true } };
default:
return { status: 400, body: { status: "error", text: "Bad Request" } };
}
} catch (e) {
return { status: 500, body: { status: "error", text: "Internal Server Error" } };
return { status: 500, body: { status: "error", text: "Internal Server Error", critical: true } };
}
}
export function metadataManager(obj) {