Skip to content

Commit

Permalink
fix: expose zhihu/zhuanlan error (DIYgod#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
magic-akari authored and DIYgod committed May 28, 2018
1 parent aae1269 commit 9edf357
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions routes/zhihu/zhuanlan.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ module.exports = async (ctx) => {
},
});

const list = listRes.data || [];
const info = infoRes.data || {};
const list = listRes.data;
const info = infoRes.data;

if (!Array.isArray(list)) {
throw JSON.stringify(list);
}

ctx.state.data = {
title: `知乎专栏-${info.name}`,
Expand Down

0 comments on commit 9edf357

Please sign in to comment.