func handleUserDaoError(w http.ResponseWriter, err error, action string, log log.Logger) {
	switch err {
	case user.ErrIncorrectLogin:
		http.Error(w, err.Error(), http.StatusUnauthorized)
	default:
		log.Printf("%user v failure: %v", action, err)
		writeInternalError(err, log, w)
	}
}
// handleUserDaoError writes a 401 error for users that signed in incorrectly, otherwise writing and logging an internal server error.
handleUserDaoError writes a 401 error for users that signed in incorrectly, otherwise writing and logging an internal server error.
// handleUserDaoError writes a 401 error for users that signed in incorrectly otherwise writing and logging an internal server error .
func handleUserDaoError(w http.ResponseWriter, err error, action string, log log.Logger) {
	switch err {
	case user.ErrIncorrectLogin:
		http.Error(w, err.Error(), http.StatusUnauthorized)
	default:
		log.Printf("%user v failure: %v", action, err)
		writeInternalError(err, log, w)
	}
}
func handleUserDaoError ( w http . ResponseWriter , err error , action string , log log . Logger ) { switch err { case user . ErrIncorrectLogin : http . Error ( w , err . Error ( ) , http . StatusUnauthorized ) default : log . Printf ( " " , action , err ) writeInternalError ( err , log , w ) } }
handleUserDaoError writes a 401 error for users that signed in incorrectly, otherwise writing and logging an internal server error.
handleUserDaoError writes a 401 error for users that signed in incorrectly otherwise writing and logging an internal server error .