Skip to content

Commit

Permalink
Handle unknown error line for whatever reason
Browse files Browse the repository at this point in the history
  • Loading branch information
angelsl committed Nov 7, 2020
1 parent 4839317 commit 26a81cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,12 @@ const handleResult = (
}

const lines = program.split('\n')
const errorLine = (lines[line - 1] || '(unknown)').trim()
return {
errorType: err.type.toLowerCase() as 'syntax' | 'runtime',
line,
location,
errorLine: lines[line - 1].trim(),
errorLine,
errorExplanation: err.explain()
}
})
Expand Down

0 comments on commit 26a81cd

Please sign in to comment.