http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Add graceful shutdown and error handling

Open Octalbyte opened this issue 3 years ago • 1 comments

This PR adds handling for fatal crashes of any type. Just so you don't have to see a giant error stack on your console.
The feature is turned on by the --no-panic option or by the environment variable NODE_HTTP_SERVER_NO_PANIC. The output is something like: image

Relevant issues

Refers partly to #665

What needs to be done:
  • [x] Add switch.
  • [x] Better log file (JSON formatting)
Contributor checklist
  • [x] Provide tests for the changes (unless documentation-only)
  • [x] Documented any new features, CLI switches, etc. (if applicable)
    • [x] Server --help output
    • [x] README.md
    • [x] doc/http-server.1 (use the same format as other entries)
  • [x] The pull request is being made against the master branch
Maintainer checklist
  • [ ] Assign a version triage tag
  • [ ] Approve tests if applicable

Octalbyte avatar Dec 25 '21 21:12 Octalbyte

Ready for review.

Octalbyte avatar Dec 27 '21 15:12 Octalbyte