Skip to content

Commit

Permalink
refactor(Warning): add line && column check
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-ciniawsky committed Aug 8, 2018
1 parent 1bbb4df commit 3786010
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ class Warning extends Error {

const { text, line, column } = warning

this.name = 'LoaderWarning'
this.message = `\n(${line}:${column}) ${text}\n`
this.name = 'Warning'

if (line && column) {
this.message = `\n(${line}:${column}) ${text}\n`
} else {
this.message = `\n${text}\n`
}

this.stack = false
}
Expand Down

0 comments on commit 3786010

Please sign in to comment.