Ignore:
Timestamp:
Feb 28, 2011, 10:46:51 AM (13 years ago)
Author:
robert@…
Message:

Improvement of the synchronization error handling and changes for deploying the module to dbnptest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/nl/tno/metagenomics/integration/SynchronizeController.groovy

    r4 r16  
    1010               
    1111                if( !redirectUrl )
    12                         redirectUrl = g.createLink( controller: 'study' );
     12                        redirectUrl = g.createLink( controller: 'run' );
    1313               
    1414                // Set the date of last synchronization to now. Doing it here, prevents the
     
    1818                //                      etc...
    1919                // synchronizationService.lastFullSynchronization = new Date();
    20                        
    2120                [ url: redirectUrl ]
    2221        }
    2322       
    2423        def perform = {
    25                 synchronizationService.sessionToken = session.sessionToken
    26                 synchronizationService.user = session.user
    27 
    28                 synchronizationService.fullSynchronization();
    29 
    30                 render "";
     24                try {
     25                        synchronizationService.sessionToken = session.sessionToken
     26                        synchronizationService.user = session.user
     27       
     28                        synchronizationService.fullSynchronization();
     29                        render "";
     30                } catch( Exception e ) {
     31                        // Catch all exceptions, show them to the user (by rendering a text message) and print a stacktrace
     32                        log.error "Exception during full synchronization: " + e.getMessage()
     33                        e.printStackTrace()
     34                       
     35                        render "An error occurred during synchronization (" + e.class?.name + "): " + e.getMessage();
     36                }
    3137        }
    3238}
Note: See TracChangeset for help on using the changeset viewer.