create error handler for auth response