package org.jboss.da.reports.backend.impl;

import org.jboss.da.communication.aprox.api.AproxConnector;
import org.jboss.da.communication.aprox.model.GAV;
import org.jboss.da.communication.aprox.model.GAVDependencyTree;
import org.jboss.da.reports.api.SCMLocator;
import org.jboss.da.reports.backend.api.DependencyTreeGenerator;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

/**
 *
 * @author Dustin Kut Moy Cheung <dcheung@redhat.com>
 *
 */
@ApplicationScoped
public class DependencyTreeGeneratorImpl implements DependencyTreeGenerator {

    @Inject
    private AproxConnector aproxConnector;

    @Override
    public GAVDependencyTree getDependencyTree(SCMLocator scml) {
        return aproxConnector.getDependencyTreeOfRevision(scml.getScmUrl(),
                scml.getRevision(), scml.getPomPath());
    }

    @Override
    public GAVDependencyTree getDependencyTree(GAV gav) {
        return aproxConnector.getDependencyTreeOfGAV(gav);
    }
}

@@ -401,16 +401,73 @@
 .Inject;
+%0Aimport org.jboss.da.communcation.CommunicationException;
 %0A%0A/**%0A *
@@ -758,24 +758,42 @@
 tor scml) %7B%0A
+        try %7B%0A    
         retu
@@ -872,16 +872,20 @@
         
+    
 scml.get
@@ -916,16 +916,116 @@
 ath());%0A
+        %7D catch (CommunicationException ex) %7B%0A            throw new RuntimeException(ex);%0A        %7D%0A
     %7D%0A%0A 
@@ -1091,24 +1091,42 @@
 (GAV gav) %7B%0A
+        try %7B%0A    
         retu
@@ -1172,16 +1172,116 @@
 V(gav);%0A
+        %7D catch (CommunicationException ex) %7B%0A            throw new RuntimeException(ex);%0A        %7D%0A
     %7D%0A%7D%0A

Fix exception handling