nodules / terror

Base error class which will help you organize errors, generate informative logs and as result grep logs more effectively
MIT License
25 stars 7 forks source link

Deprecate Terror.ensureError #28

Open narqo opened 9 years ago

narqo commented 9 years ago

Terror.ensureError() looks like a rudimental method. All it does is call to Terror.createError() in case passed error object is not a Terror instance. And the most strange thing here is that it's arguments are swapped if you compare it with createError. Take a look:

Terror.ensureError = function(error, code) {
  return /*···*/ this.createError(code, error);
};

I propose to deprecate Terror.ensureError() and use Terror.createError() only.

kaero commented 9 years ago

lgtm as an idea