Skip to content

Commit

Permalink
fix: kill nightmare if response.code not 200 or doc is not a respec d…
Browse files Browse the repository at this point in the history
…oc (#977)
  • Loading branch information
deniak authored and Marcos Cáceres committed Nov 29, 2016
1 parent f7ea0d4 commit dc1fcef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/respecDocWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const tasks = {
if (response.code !== 200) {
const warn = colors.warn(`📡 HTTP Error ${response.code}:`);
const msg = `${warn} ${colors.debug(url)}`;
nightmare.proc.kill();
throw new Error(msg);
}
const isRespecDoc = yield nightmare
Expand All @@ -113,6 +114,7 @@ const tasks = {
});
if(!isRespecDoc){
const msg = `${colors.warn("💣 Not a ReSpec source document?")} ${colors.debug(url)}`;
nightmare.proc.kill();
throw new Error(msg);
}
const html = yield nightmare
Expand Down

0 comments on commit dc1fcef

Please sign in to comment.