Skip to content

Commit

Permalink
fix(style): use assert instead of console.error
Browse files Browse the repository at this point in the history
  • Loading branch information
czosel committed May 13, 2019
1 parent e6552a0 commit 1d75b8d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions addon/lib/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,11 @@ export default EmberObject.extend(Evented, {
*/
validate: task(function*() {
const specificValidation = this.get(`_validate${this.question.__typename}`);
if (!specificValidation) {
// eslint-disable-next-line no-console
console.error(
"Missing validation function for",
this.question.__typename
);
}
assert(
"Missing validation function for " + this.question.__typename,
specificValidation
);

const validationFns = [
...(!this.question.hidden ? [this._validateRequired] : []),
specificValidation
Expand Down

0 comments on commit 1d75b8d

Please sign in to comment.