-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Codes #206
Comments
Can you show me an example of such error? |
Gladly :) For example, the Model function var ORMError = function(msg, code[, constr]) {
Error.captureStackTrace(this, constr || ORMError);
this.message = msg;
this.code = code;
};
util.inherits(ORMError, Error); Now, we can use var NotFoundError = function(msg) {
this.super_.call(this, msg, SOME_CODE, this.constructor);
};
util.inherits(NotFoundError, ORMError); This is something that could be phased in without affecting any existing code since every custom error will already effectively be an error. |
Ok, I clearly see your point. You would like to have a way of distinguishing the errors without parsing a string (that might change). We have to identify them and create codes for them, perhaps having a global orm file with the list of codes (that people can lookup) and orm will use. I have to create a basic one, perhaps starting with the |
There should be more missing errors there, I have to change all of them. If you find any, feel free to change it. |
I think I added most of them. If you find any please reopen. |
This may be a sizable undertaking, but I think should be considered. I've come across a situation in which one particular error of a few that may be returned by ORM is OK. However, the only way to identify that error is by the string message. There should be some other more stable identifying piece of information such as an error code, in addition to the messages.
The text was updated successfully, but these errors were encountered: