Logging the error when get a bad requst