I set up a very basic test
function MyError(msg){
this.name = 'MyError';
this.message = msg;
Error.call(this, msg);
Error.captureStackTrace(this, this.constructor);}
MyError('New error')
And that works fine.
However in my full app, I hit the below issue. Is there someway I could
have mashed captureStackTrace in my code set? I grepped it, and there
aren't any obvious missuses of the name.
I'm trying to use validation provided by Mongoose, so have a scheme
var MeecaptureStackTracetingSchema = new Schema({
title: {type: String, required : true}....
Trying to save without setting the title - gets to the below point,
Mongoose wants to return the error for the missing fields but falls over
with " no method 'captureStackTrace'"
/mongoose/lib/error.jsfunction MongooseError (msg) { // Validator "required"
failed for path title with value `undefined`
Error.call(this);
Error.captureStackTrace(this, arguments.callee); // Falls over here
this.message = msg;
this.name = 'MongooseError';};
Throws this error
TypeError: Object function model(doc, fields, skipId) {
if (!(this instanceof model))
return new model(doc, fields, skipId);
Model.call(this, doc, fields, skipId);
} has no method 'captureStackTrace'
Thanks,
Brent
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.