@@ -343,7 +343,8 @@ public QueuedWorkflow createQueuedWorkflow(GitDetails gitInfo)
343343 List <WorkflowOverview > overviews =
344344 cwlService .getWorkflowOverviewsFromPacked (workflowFile .toFile ());
345345 if (overviews .size () == 0 ) {
346- throw new IOException ("No workflow was found within the packed CWL file" );
346+ throw new IOException (
347+ "No workflow was found within the packed CWL file. " + gitInfo .toSummary ());
347348 } else {
348349 // Dummy queued workflow object to return the list
349350 QueuedWorkflow overviewList = new QueuedWorkflow ();
@@ -375,14 +376,14 @@ public QueuedWorkflow createQueuedWorkflow(GitDetails gitInfo)
375376 try {
376377 cwlToolRunner .createWorkflowFromQueued (queuedWorkflow );
377378 } catch (Exception e ) {
378- logger .error ("Could not update workflow with cwltool" , e );
379+ logger .error ("Could not update workflow with cwltool: " + gitInfo . toSummary () , e );
379380 }
380381
381382 } catch (GitAPIException | RuntimeException | IOException e ) {
382383 logger .warn (
383384 String .format (
384- "Failed to create Queued Workflow: %s - Temporary files will be deleted" ,
385- e .getMessage ()),
385+ "Failed to create Queued Workflow: %s - Temporary files will be deleted for %s. " ,
386+ e .getMessage (), gitInfo . toSummary () ),
386387 e );
387388 FileUtils .deleteGitRepository (repo );
388389 throw e ;
@@ -406,7 +407,7 @@ public void retryCwltool(QueuedWorkflow queuedWorkflow) {
406407 try {
407408 cwlToolRunner .createWorkflowFromQueued (queuedWorkflow );
408409 } catch (Exception e ) {
409- logger .error ("Could not update workflow with cwltool" , e );
410+ logger .error ("Could not update workflow " + queuedWorkflow . getId () + " with cwltool. " , e );
410411 }
411412 }
412413
@@ -481,13 +482,14 @@ public PathResource getWorkflowGraph(String format, GitDetails gitDetails)
481482 extension = "dot" ;
482483 break ;
483484 default :
484- throw new WorkflowNotFoundException ();
485+ throw new WorkflowNotFoundException ("Format " + format + " not recognized." );
485486 }
486487
487488 // Get workflow
488489 Workflow workflow = getWorkflow (gitDetails );
489490 if (workflow == null ) {
490- throw new WorkflowNotFoundException ();
491+ throw new WorkflowNotFoundException (
492+ "Unable to retrieve workflow for " + gitDetails .toSummary ());
491493 }
492494
493495 // Generate graph and serve the file
@@ -506,7 +508,9 @@ private void generateROBundle(Workflow workflow) {
506508 try {
507509 ROBundleFactory .createWorkflowRO (workflow );
508510 } catch (Exception ex ) {
509- logger .error ("Error creating RO Bundle" , ex );
511+ logger .error (
512+ "Error creating RO Bundle for workflow from " + workflow .getRetrievedFrom ().toSummary (),
513+ ex );
510514 }
511515 }
512516
@@ -520,9 +524,9 @@ private void removeWorkflow(Workflow workflow) {
520524 if (workflow .getRoBundlePath () != null ) {
521525 File roBundle = new File (workflow .getRoBundlePath ());
522526 if (roBundle .delete ()) {
523- logger .debug ("Deleted Research Object Bundle" );
527+ logger .debug ("Deleted Research Object Bundle for workflow " + workflow . getID () );
524528 } else {
525- logger .debug ("Failed to delete Research Object Bundle" );
529+ logger .info ("Failed to delete Research Object Bundle for workflow " + workflow . getID () );
526530 }
527531 }
528532
@@ -556,7 +560,8 @@ private boolean cacheExpired(Workflow workflow) {
556560 if (expirationDate .before (new Date ())) {
557561 // Cache expiry time has elapsed
558562 // Check current head of the branch with the cached head
559- logger .info ("Time has expired for caching, checking commits..." );
563+ logger .info (
564+ "Time has expired for caching, checking commits for workflow " + workflow .getID ());
560565 String currentHead ;
561566 boolean safeToAccess = gitSemaphore .acquire (workflow .getRetrievedFrom ().getRepoUrl ());
562567 try {
@@ -565,7 +570,13 @@ private boolean cacheExpired(Workflow workflow) {
565570 } finally {
566571 gitSemaphore .release (workflow .getRetrievedFrom ().getRepoUrl ());
567572 }
568- logger .info ("Current: " + workflow .getLastCommit () + ", HEAD: " + currentHead );
573+ logger .info (
574+ "Current: "
575+ + workflow .getLastCommit ()
576+ + ", HEAD: "
577+ + currentHead
578+ + " for workflow "
579+ + workflow .getID ());
569580
570581 // Reset date in database if there are still no changes
571582 boolean expired = !workflow .getLastCommit ().equals (currentHead );
@@ -579,7 +590,10 @@ private boolean cacheExpired(Workflow workflow) {
579590 }
580591 } catch (Exception ex ) {
581592 // Default to no expiry if there was an API error
582- logger .error ("API Error when checking for latest commit ID for caching" , ex );
593+ logger .error (
594+ "API Error when checking for latest commit ID for caching for workflow "
595+ + workflow .getID (),
596+ ex );
583597 }
584598 }
585599 return false ;
0 commit comments