throw exception for nonexistent languages in VOA

This commit is contained in:
zph 2021-01-08 18:02:14 +08:00
parent 30ff4ff172
commit d1fb755da6
1 changed files with 2 additions and 0 deletions

View File

@ -13,6 +13,8 @@ module.exports = async (ctx) => {
case 'tibetan':
baseURL = 'https://www.voatibetan.com/';
break;
default:
throw Error('The language specified does not exist');
}
const response = await got.get(baseURL + 'api/' + ctx.params.channel || '');