package br.leosilvadev.proxy.resolvers;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeoutException;

import org.apache.http.HttpStatus;

public class ResponseErrorResolver {

	private static final Map<Class<? extends Throwable>, Integer> errors;

	static {
		errors = new HashMap<>();
		errors.put(TimeoutException.class, HttpStatus.SC_GATEWAY_TIMEOUT);
	}

	public static Integer resolveStatus(Throwable ex) {
		for (Class<? extends Throwable> clazz : errors.keySet()) {
			if (clazz.isInstance(ex)) return errors.get(clazz);
		}
		return HttpStatus.SC_INTERNAL_SERVER_ERROR;
	}
}

@@ -133,44 +133,8 @@
 n;%0A%0A
-import org.apache.http.HttpStatus;%0A%0A
 publ
@@ -318,37 +318,11 @@
 ss, 
-HttpStatus.SC_GATEWAY_TIMEOUT
+504
 );%0A%09
@@ -510,43 +510,11 @@
 urn 
-HttpStatus.SC_INTERNAL_SERVER_ERROR
+500
 ;%0A%09%7D

fix test