Skip to content

Improve error handling in controllers#324

Open
markspolakovs wants to merge 11 commits intodevelopmentfrom
marks/errors
Open

Improve error handling in controllers#324
markspolakovs wants to merge 11 commits intodevelopmentfrom
marks/errors

Conversation

@markspolakovs
Copy link
Member

This PR makes various changes related to error handling in the HTTP controllers, most of which fall into one of two changes:

  1. Instead of either just logging the error and returning a blank screen or rendering a 404, delegate all controller error handling to Controllers.handleError, which takes care of logging it (with context), as well as rendering an appropriate template. (In the process this also introduces a 500 template.)
  2. Remove the error return from utils.RenderTemplate, since all callers were just doing a log.Println(err); return anyway. Instead have utils take care of logging it, with appropriate context.

Depends on UniversityRadioYork/myradio-go#64.

Fixes #180.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle errors better

2 participants