[TAP,UWS] Manage thrown Error properly in synchronous and asynchronous jobs...
[TAP,UWS] Manage thrown Error properly in synchronous and asynchronous jobs execution + Modify some log messages + Add log messages in JDBCConnection (for add and drop uploaded tables).
service.getLogger().logTAP(LogLevel.ERROR,this,"SYNC_END","An error occured while executing the query of the synchronous job "+ID+": "+error.getMessage(),error);
service.getLogger().logTAP(LogLevel.ERROR,this,"SYNC_END","An error occured while executing the query of the synchronous job "+ID+".",error);
// report the error to the user:
throw(TAPException)error;
}
// ANY OTHER EXCEPTION:
else{
// log the error:
service.getLogger().logTAP(LogLevel.FATAL,this,"SYNC_END","An unexpected error has stopped the execution of the synchronous job "+ID+": "+error.getMessage(),error);
service.getLogger().logTAP(LogLevel.FATAL,this,"SYNC_END","An unexpected error has stopped the execution of the synchronous job "+ID+".",error);
DBExceptionde=newDBException("Impossible to create the user uploaded table in the database: "+translator.getQualifiedTableName(tableDef)+"! This table already exists.");
@@ -1516,6 +1517,9 @@ public class JDBCConnection implements DBConnection {
// Commit the transaction:
commit();
// Log the end:
logger.logDB(LogLevel.INFO,this,"TABLE_CREATED","Table \""+tableDef.getADQLName()+"\" (in DB: "+translator.getQualifiedTableName(tableDef)+") created.",null);
returntrue;
}catch(SQLExceptionse){
@@ -1633,6 +1637,12 @@ public class JDBCConnection implements DBConnection {
logger.logDB(LogLevel.INFO,this,"TABLE_DROPPED","Table \""+tableDef.getADQLName()+"\" (in DB: "+translator.getQualifiedTableName(tableDef)+") dropped.",null);
else
logger.logDB(LogLevel.ERROR,this,"TABLE_DROPPED","Table \""+tableDef.getADQLName()+"\" (in DB: "+translator.getQualifiedTableName(tableDef)+") NOT dropped.",null);
writeError("INTERNAL SERVER ERROR! Sorry, this error is unexpected and no explaination can be provided for the moment. Details about this error have been reported in the service log files ; you should try again your request later or notify the administrator(s) by yourself (with the following REQ_ID).",ErrorType.FATAL,UWSException.INTERNAL_SERVER_ERROR,response,request,reqID,user,action);
}
writeError("INTERNAL SERVER ERROR! Sorry, this error is grave and unexpected. No explaination can be provided for the moment. Details about this error have been reported in the service log files ; you should try again your request later or notify the administrator(s) by yourself (with the following REQ_ID).",ErrorType.FATAL,UWSException.INTERNAL_SERVER_ERROR,response,request,reqID,user,action);