Skip to content

Commit

Permalink
Improve aws batch error logging
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Feb 17, 2023
1 parent fced376 commit 8f4884c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import java.util.concurrent.TimeUnit
import com.amazonaws.services.batch.AWSBatch
import com.amazonaws.services.batch.model.AWSBatchException
import com.amazonaws.services.ecs.model.AccessDeniedException
import com.amazonaws.services.logs.model.ResourceNotFoundException
import com.upplication.s3fs.S3Path
import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
Expand Down Expand Up @@ -285,10 +286,13 @@ class AwsBatchExecutor extends Executor implements ExtensionPoint {
try {
return helper.getTaskLogStream(jobId)
}
catch (ResourceNotFoundException e) {
log.debug "Unable to find AWS Cloudwatch logs for Batch Job id=$jobId - ${e.message}"
}
catch (Exception e) {
log.debug "Unable to retrieve AWS Cloudwatch logs for Batch Job id=$jobId | ${e.message}", e
return null
}
return null
}

@Override
Expand Down

0 comments on commit 8f4884c

Please sign in to comment.