Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Make error pages opt-in #24

Closed
daffl opened this issue Feb 18, 2016 · 4 comments
Closed

Make error pages opt-in #24

daffl opened this issue Feb 18, 2016 · 4 comments

Comments

@daffl
Copy link
Member

daffl commented Feb 18, 2016

As seen in feathersjs-ecosystem/feathers-mongoose#56 it is very easy to make a request and get an error page which looks like a mistake. Services on the other hand always return JSON. I'm wondering if we should make the HTML error pages opt-in (passing the filename in the options) and add them to the generator instead.

@marshallswain
Copy link
Member

I would definitely appreciate this.

@ekryski
Copy link
Member

ekryski commented Feb 18, 2016

It may sound stupid but I think it’s actually sort of important to support this by default because it gives people a sense of security and makes Feathers look polished. Like, ​_”man these guys have thought of everything. Even minimal error pages”_​.

If you don't want to use the middleware you can easily just write your own or use a different express error handler.

That being said I think we should do 3 things:

  • you should be able to turn off HTML with something like html:false
  • we should also check to see if the request was XHR and if it doesn't accept JSON assume the user forgot to set the Accepts header.
  • We should provide a default.html page that show a "General Error" for any non 404 or 500 errors.

@marshallswain
Copy link
Member

That sounds reasonable.

@daffl
Copy link
Member Author

daffl commented Mar 2, 2016

Opting in has been added in #25

@daffl daffl closed this as completed Mar 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants