Handle 400 errors differently than 500 errors