This commit is contained in:
Francesco Mangiacrapa 2014-10-14 16:19:15 +00:00
parent 79176ab3e5
commit d62d428bc3
2 changed files with 9 additions and 4 deletions

View File

@ -14,7 +14,6 @@ import org.gcube.portlets.user.uriresolvermanager.exception.UriResolverMapExcept
import org.gcube.portlets.user.uriresolvermanager.readers.RuntimeResourceReader;
import org.gcube.portlets.user.uriresolvermanager.readers.UriResolverMapReader;
import org.gcube.portlets.user.uriresolvermanager.util.HttpCallerUtil;
import org.gcube.portlets.user.uriresolvermanager.util.UrlEncoderUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -93,7 +92,8 @@ public class UriResolverManager {
} catch (IllegalArgumentException e){
throw e;
} catch (Exception e) {
throw new UriResolverMapException("Runtime Resource reader exception");
logger.error("Uri Resolver error: ", e);
throw new UriResolverMapException("Uri Resolver error: " +e.getMessage());
}
return "";
}

View File

@ -80,8 +80,13 @@ public class HttpCallerUtil {
int statusCode = client.executeMethod(method);
if (statusCode != HttpStatus.SC_OK) {
logger.error("Method failed: " + method.getStatusLine() + "Status text: " +method.getStatusText());
throw new Exception("Failed HTTP caller on "+fullUrl +" Response status line: " + method.getStatusLine() + ", body response: " +method.getResponseBodyAsString());
logger.error("Method failed: " + method.getStatusLine());
// try{
// method.getResponseBodyAsString();
// }catch(Exception e){
//
// }
throw new Exception("Failed HTTP caller on "+fullUrl +" Response status line: " + method.getStatusLine());
}
// Read the response body.