Ignore:
Timestamp:
Feb 28, 2011, 1:49:07 PM (13 years ago)
Author:
robert@…
Message:

Better error handling during synchronization

File:
1 edited

Legend:

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

    r16 r17  
    3030                } catch( Exception e ) {
    3131                        // 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()
     32                        def message = e.getMessage();
     33                        if( !message || message == 'null' )
     34                                message = 'unknown error';
     35               
     36                        // Show errors in log file             
     37                        log.error "Exception during full synchronization: " + message
    3338                        e.printStackTrace()
    3439                       
    35                         render "An error occurred during synchronization (" + e.class?.name + "): " + e.getMessage();
     40                        // Give the user a nice error message
     41                        response.status = 500;
     42                        render "An error occurred during synchronization (" + e.class?.name + "): " + message;
    3643                }
    3744        }
Note: See TracChangeset for help on using the changeset viewer.