Open jaumard opened 8 years ago
@context trailpack-waterline/api/Services/FootprintService
I guess that this error is due to an undefined reference when a model is recovered from app.orm
or app.packs.waterline.orm.collections
in FootprintService
(line 38 for example).
All FootprintService
methods can throws similar error (model not found).
Why there are no check to be sure if a model exists?
@jaumard is this still an issue or can we close?
Still an issue but not for hapi I think because it have to be fix/check on trailpack-router
or trailpack-footprints
or each trailpack-datastore
Like @enten say there is no check to see if the model exist. Where we could put this issue ?
@weyj4 Here is how I fix this for Express and Sequelize On Footprint service (sequelize) : https://github.com/trailsjs/trailpack-sequelize/blob/master/api/services/FootprintService.js#L27 On Footprint controller (express) : https://github.com/trailsjs/trailpack-express/blob/master/api/controllers/FootprintController.js#L25
With this Footprint controller web server doesn't send a 500 whatever the server is (as hapi do actually).
Is there a way I can help with this? I have particular interest on fixing the king of errors jaumard refers to on his last comment. Related to this: https://github.com/trailsjs/trailpack-sequelize/pull/23
How to pass criteria = { column is not null} ?
If we call a route like
/api/v1/default/toto
, I have this error :A better error message can be send like
no model default
or just500 server error