Factor out error handling code into _handle_error
get -> get_post