Skip to content

Improve error message

Compare
Choose a tag to compare
@cherifGsoul cherifGsoul released this 09 Oct 16:15
· 26 commits to master since this release

Improve error message by including the type of the value being set:

class Person extends ObservableObject() {
   static get props() {
      return {
	age: type.check(Number)
      };
   }
}

var farah = new Person();
farah.age = '4';  // -> Uncaught Error: 4 (String) is not of type Number.