Update Request.java for proper error handling.