Ellisande / mockolate

Simple mocking framework for JS
MIT License
1 stars 3 forks source link

Better Errors #12

Open Ellisande opened 8 years ago

Ellisande commented 8 years ago

What kind of issue is this? (bug, feature, etc)

Feature

What is the proposed change?

It just news up the JavaScript error object and passes a message

Why will this be beneficial?

It will help the consume identify if they are not using the APIs correctly.

Misc. info

Thoughts for a starter:

class UndefinedThenError extends Error {
    constructor(){
      super();
      this.likelyReasons = likelyReasons;
      this.message = straightErrorMessage + likelyReasons + prettyFormatting
    }
}