git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/uri-resolver-manager@100684 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
79176ab3e5
commit
d62d428bc3
|
@ -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 "";
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue