Skip to content
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

adapter error on Model.create #30

Open
172478394 opened this issue Aug 29, 2016 · 4 comments
Open

adapter error on Model.create #30

172478394 opened this issue Aug 29, 2016 · 4 comments

Comments

@172478394
Copy link

I get this error when i call Model.create() after setting schema to false:

/node_modules/waterline/lib/waterline/error/WLError.js:29
this.rawStack = (this.e.stack.replace(/^Error(\r|\n)(\r|\n)_/, ''));

TypeError: Cannot read property 'replace' of undefined
at new WLError (/usr/lib/node_modules/sails/node_modules/waterline/lib/waterline/error/WLError.js:29:33)
at duckType (/usr/lib/node_modules/sails/node_modules/waterline/lib/waterline/error/index.js:66:10)
at errorify (/usr/lib/node_modules/sails/node_modules/waterline/lib/waterline/error/index.js:39:10)
at wrappedCallback (/usr/lib/node_modules/sails/node_modules/waterline/lib/waterline/utils/normalize.js:329:15)
at callback.error (/usr/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/normalize.js:42:31)
at _switch (/usr/lib/node_modules/sails/node_modules/waterline/node_modules/switchback/lib/factory.js:56:28)
at /home/leoyu/dynamoProject/node_modules/sails-dynamodb/index.js:850:11
at /home/leoyu/dynamoProject/node_modules/vogels/lib/table.js:119:14
at start (/home/leoyu/dynamoProject/node_modules/vogels/lib/table.js:108:12)
at fn (/home/leoyu/dynamoProject/node_modules/vogels/node_modules/async/lib/async.js:626:34)
at Immediate._onImmediate (/home/leoyu/dynamoProject/node_modules/vogels/node_modules/async/lib/async.js:542:34)
at tryOnImmediate (timers.js:543:15)
at processImmediate as _immediateCallback

@devinivy
Copy link
Collaborator

That looks like an error that occurred within waterline– hard to tell if it has to do with this adapter or not. Can you get a hold of that error waterline was trying to display (but failed to display, since its stack was undefined)?

@devinivy
Copy link
Collaborator

It may involve some logging here:

cb(err);

@traverseDLP
Copy link

The error occurs because the waterline adapter is trying to be clever when
formatting the raw stack to be logged, and using a property that doesn't
exist. If you're looking to get closer to the root problem, just edit

{application
root}/node_modules/sails/node_modules/waterline/lib/waterline/error/WLError.js

Replace lines 28 and 29 with this:

// Doctor up a modified version of the stack trace called rawStack:
this.rawStack =
this.e.stack;//(this.e.stack.replace(/^Error(\r|\n)(\r|\n)/, ''));

Someone could actually fix it in the repo, too...

Sam Brown
Lead Developer & VP of Technology
207.475.7779 <207-475-7779> | sam@traversedlp.com
@traverseDLP http://twitter.com/traversedlp | www.traversedlp.com

On Mon, Aug 29, 2016 at 8:27 AM, devin ivy notifications@github.com wrote:

It may involve some logging here: https://github.com/
gadelkareem/sails-dynamodb/blob/fa295c1d383b2dc020de3438ab60af
63e32970c1/index.js#L850


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#30 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AOU3KpCtLJc8j5SGKISGuaQ0P77E9Hcnks5qktA7gaJpZM4JvSri
.

@172478394
Copy link
Author

I want to store some key-value, but they are not in the schema, how should I do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants