koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
104 stars 32 forks source link

Poor error handling #48

Closed ygalashov closed 6 years ago

ygalashov commented 6 years ago

https://github.com/koopjs/FeatureServer/blob/7cabe2a63573fedb83ff4226e8e015b59d78cc35/src/route.js#L42 https://github.com/koopjs/FeatureServer/blob/7cabe2a63573fedb83ff4226e8e015b59d78cc35/src/route.js#L54 https://github.com/koopjs/FeatureServer/blob/7cabe2a63573fedb83ff4226e8e015b59d78cc35/src/route.js#L75 You can't tell what is the issue, what is the error about, and where it appears. I had to use debugger and trace every single error. Please add logs here or use single error handler and output error trace and message, and as much info as possible for error handling. This will save a lot of time and we will be more efficient this way!

dmfenton commented 6 years ago

If you run with NODE_ENV=test you'll get a full stack trace for errors in your console. It's not generally a good practice to leak those stack traces to your end users.

ygalashov commented 6 years ago

I'm talking about console output here, not about sending it as a response. If you have problems or concerns about writing debug data to console then use something as debug to filter output. It's not a good practice to get optional console output depending on environment, especially using 'test' one.