feat: error message for bilibili bangumi when the api return… (#4117)

This commit is contained in:
Luyu Huang 2020-02-29 20:19:00 +08:00 committed by GitHub
parent 12e21218bb
commit 374ac856b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -13,6 +13,9 @@ module.exports = async (ctx) => {
},
});
const data = response.data;
if (data.code !== 0) {
throw Error(`It looks like something went wrong when querying the Bilibili API: code = ${data.code}, message = ${data.message}`);
}
ctx.state.data = {
title: `${name} 的追番列表`,