← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11892: Improved user feedback on errors in analytics table generation process

 

------------------------------------------------------------
revno: 11892
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-09-03 21:31:42 +0200
message:
  Improved user feedback on errors in analytics table generation process
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/scheduling/ResourceTableTask.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/scheduling/AnalyticsTableTask.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/scheduling/ResourceTableTask.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/scheduling/ResourceTableTask.java	2013-09-03 19:24:00 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/scheduling/ResourceTableTask.java	2013-09-03 19:31:42 +0000
@@ -65,13 +65,12 @@
         try
         {
             resourceTableService.generateAll();
+            
+            notifier.notify( taskId, NotificationLevel.INFO, "Resource tables generated", true );
         }
         catch ( RuntimeException ex )
         {
             notifier.notify( taskId, NotificationLevel.ERROR, "Process failed: " + ex.getMessage(), true );
-            return;
         }
-        
-        notifier.notify( taskId, NotificationLevel.INFO, "Resource tables generated", true );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/scheduling/AnalyticsTableTask.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/scheduling/AnalyticsTableTask.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/scheduling/AnalyticsTableTask.java	2013-09-03 19:31:42 +0000
@@ -28,6 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import static org.hisp.dhis.system.notification.NotificationLevel.ERROR;
 import static org.hisp.dhis.system.notification.NotificationLevel.INFO;
 
 import javax.annotation.Resource;
@@ -84,25 +85,32 @@
     public void run()
     {
         notifier.clear( taskId ).notify( taskId, "Updating resource tables" );
-        
-        resourceTableService.generateAll();
-
-        notifier.notify( taskId, "Updating analytics tables" );
-        
-        analyticsTableService.update( last3Years, taskId );
-        
-        notifier.notify( taskId, "Updating completeness tables" );
-        
-        completenessTableService.update( last3Years, taskId );
-
-        notifier.notify( taskId, "Updating compeleteness target table" );
-        
-        completenessTargetTableService.update( last3Years, taskId );
-        
-        notifier.notify( taskId, "Updating event analytics tables" );
-        
-        eventAnalyticsTableService.update( last3Years, taskId );
-        
-        notifier.notify( taskId, INFO, "Analytics tables updated", true );
+
+        try
+        {
+            resourceTableService.generateAll();
+    
+            notifier.notify( taskId, "Updating analytics tables" );
+            
+            analyticsTableService.update( last3Years, taskId );
+            
+            notifier.notify( taskId, "Updating completeness tables" );
+            
+            completenessTableService.update( last3Years, taskId );
+    
+            notifier.notify( taskId, "Updating compeleteness target table" );
+            
+            completenessTargetTableService.update( last3Years, taskId );
+            
+            notifier.notify( taskId, "Updating event analytics tables" );
+            
+            eventAnalyticsTableService.update( last3Years, taskId );
+            
+            notifier.notify( taskId, INFO, "Analytics tables updated", true );
+        }
+        catch ( RuntimeException ex )
+        {
+            notifier.notify( taskId, ERROR, "Process failed: " + ex.getMessage(), true );
+        }
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java	2013-09-03 19:31:42 +0000
@@ -207,7 +207,7 @@
         catch ( RuntimeException ex )
         {
             log.error( DebugUtils.getStackTrace( ex ) );
-            notifier.notify( id, ERROR, "Unfortunately the process failed, check the logs", true );
+            notifier.notify( id, ERROR, "Process failed: " + ex.getMessage(), true );
             return new ImportSummary( ImportStatus.ERROR, "The import process failed: " + ex.getMessage() );
         }
     }
@@ -222,7 +222,7 @@
         catch ( Exception ex )
         {
             log.error( DebugUtils.getStackTrace( ex ) );
-            notifier.notify( id, ERROR, "Unfortunately the process failed, check the logs", true );
+            notifier.notify( id, ERROR, "Process failed: " + ex.getMessage(), true );
             return new ImportSummary( ImportStatus.ERROR, "The import process failed: " + ex.getMessage() );
         }
     }
@@ -237,7 +237,7 @@
         catch ( RuntimeException ex )
         {
             log.error( DebugUtils.getStackTrace( ex ) );
-            notifier.clear( id ).notify( id, ERROR, "Unfortunately the process failed, check the logs", true );
+            notifier.clear( id ).notify( id, ERROR, "Process failed: " + ex.getMessage(), true );
             return new ImportSummary( ImportStatus.ERROR, "The import process failed: " + ex.getMessage() );
         }
     }
@@ -253,7 +253,7 @@
         catch ( RuntimeException ex )
         {
             log.error( DebugUtils.getStackTrace( ex ) );
-            notifier.clear( id ).notify( id, ERROR, "Unfortunately the process failed, check the logs", true );
+            notifier.clear( id ).notify( id, ERROR, "Process failed: " + ex.getMessage(), true );
             return new ImportSummary( ImportStatus.ERROR, "The import process failed: " + ex.getMessage() );
         }
     }