refactored request error handlers