handle Exception and remove duplication in errors.py
handle Exception and remove duplication in errors.py

ensure that if unexpected Exceptions are thrown, we handle them correctly
(log and then return JSON)

also remove some branches that will never trip, and combine a couple of
identical functions

alphagov/notifications-api,alphagov/notifications-api