Handle 504 errors