pofider / node-simple-odata-server

Simple OData server for node.js
MIT License
97 stars 61 forks source link

Add more error handling #12

Open pickworth opened 9 years ago

pickworth commented 9 years ago

handle undefined entityType

pickworth commented 9 years ago

This was also required in my node application to stop it from crashing under certain data conditions

pofider commented 9 years ago

In what conditions the entityType is not found? Seems to me it should be always found for the collection so we should rather find the reason why it is not found rather than silently ignore this.

pickworth commented 9 years ago

I'm dynamically creating entityTypes from an elasticsearch query (using get mappings API). Sometimes the mapping for a dataset does not exist. Therefore, an entityType will not exist for a EntitySet in my case. With this and #11 and #13, the API will still function (i.e return data) and not crash the node process.