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

CastError surfacing still an issue #10

Open
joshkopecek opened this issue May 16, 2016 · 3 comments
Open

CastError surfacing still an issue #10

joshkopecek opened this issue May 16, 2016 · 3 comments

Comments

@joshkopecek
Copy link
Contributor

Despite using mongoose.Error() when I use the Schema Types in another project I get this:

Unhandled rejection ValidationError: CastError: Cast to Point failed for value "[object Object]" at path "loc"

and no 'reason' which is less than helpful since I can't see why my object is not passing. Building a custom error seems unnecessarily onerous (Automattic/mongoose#4113).

Thoughts @markstos ?

@markstos
Copy link
Contributor

Ugh. I'm not sure what to do here. It seems like a might be an ordering issue, like the CastError is being thrown before the custom error. At this point I would resort to reading the Mongoose code and tracing the flow of what's happening.

@benfletcher
Copy link

I've opened a new Mongoose issue requesting the option to disable type casting. Saw several of your issues that might be more easily handled if this were an option.

Automattic/mongoose#4745

@joshkopecek
Copy link
Contributor Author

Saw that that issue was closed on mongoose without resolution. I will leave this open as there is no current resolution for it.

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