JanitorTechnology / janitor

The fastest development system in the world.
https://janitor.technology
GNU Affero General Public License v3.0
128 stars 22 forks source link

Show nice error pages for proxy errors #117

Open jankeromnes opened 7 years ago

jankeromnes commented 7 years ago

The web app https://janitor.technology already has a very basic 404 page, e.g. https://janitor.technology/no/such/page.html

However, proxy servers (i.e. Docker container hosts) like https://moz1.janitor.technology use a variety of error codes, but currently send empty HTML responses (using request.end()) along with them. This makes error cases hard to understand for users (because they only see a blank page, and the error code is only visible in the browser's devtools), e.g. https://moz1.janitor.technology/0000000000000000/0000/oops.html

Instead, it would be nice to show explicit error pages (beautiful but very simple, with helpful explanations of what the problem might be, but without leaking internal errors). The following error cases need pages:

Replying with actual web content can be done by adding new HTML template routes to /lib/routes.js.

@nt1m would you be interested in taking on this issue?

Note: This could be an opportunity to add new web pages that don't use Bootstrap, see also #113.

nt1m commented 7 years ago

Seems like you've fixed this.

jankeromnes commented 7 years ago

No I didn't, as you can see by trying to access port 8080 of a Janitor container where no server is running: I expect an easy to understand error page, however instead I get a blank page, and I have to open the devtools to notice that the status is 503.

This is a great place for new UI that doesn't use any existing framework (proxy server doesn't serve any web pages directly yet).

nt1m commented 7 years ago

Hmm, I was convinced your proxy PR added this. Perhaps it was for some error codes only. I'll look at this then.

nt1m commented 7 years ago

Ah, I see that if you access port 8088888, it shows a blank page :)