mers icon indicating copy to clipboard operation
mers copied to clipboard

MissingSchemaError instead of 404

Open iliakan opened this issue 12 years ago • 3 comments

Hi,

I tried mers in my project: app.use('/rest', mers({..}).rest())

...But when I visit /rest/none where none is an unknown schema, I get error:

   500 MissingSchemaError: Schema hasn't been registered for model "undefined". Use mongoose.model(name, schema)

It's strange to see 500 here, because "non-existant" has the code of 404.

iliakan avatar Oct 29 '13 12:10 iliakan

Good point will review error codes

Sent from my iPhone

On Oct 29, 2013, at 8:42 AM, iliakan [email protected] wrote:

Hi,

I tried mers in my project: app.use('/rest', mers({..}).rest())

...But when I visit /rest/none where none is an unknown schema, I get error:

500 MissingSchemaError: Schema hasn't been registered for model "undefined". Use mongoose.model(name, schema)

It's strange to see 500 here, because "non-existant" has the code of 404.

— Reply to this email directly or view it on GitHubhttps://github.com/jspears/mers/issues/19 .

jspears avatar Oct 29 '13 12:10 jspears

The execution gets to the point where it shouldn't get imo.

iliakan avatar Oct 29 '13 13:10 iliakan

Patches welcomed.

Sent from my iPhone

On Oct 29, 2013, at 9:37 AM, iliakan [email protected] wrote:

The execution gets to the point where it shouldn't get imo.

— Reply to this email directly or view it on GitHubhttps://github.com/jspears/mers/issues/19#issuecomment-27302900 .

jspears avatar Oct 29 '13 18:10 jspears