Skip to content

Commit

Permalink
update documentation and test with previous exception
Browse files Browse the repository at this point in the history
Signed-off-by: jorgee <jorge.ejarque@seqera.io>
  • Loading branch information
jorgee committed Oct 22, 2024
1 parent 19360ce commit 54e0442
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/reference/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ The following task properties are defined in the process body:
: *Available only in `exec:` blocks*
: The current task name.

`task.previousError`
`task.previousException`
: :::{versionadded} 24.10.0
:::
: The error message of the task execution.
: Since the error message is only available after the task has been executed, it can only be used when `task.attempt` is bigger than 1.
: The task execution of previous execution.
: Since the exception is only available after the task has been executed, it can only be used when `task.attempt` is bigger than 1.

`task.previousTrace`
: :::{versionadded} 24.10.0
Expand Down
2 changes: 1 addition & 1 deletion tests/checks/trace-access.nf/.checks
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ $NXF_RUN | tee stdout
[[ `grep 'INFO' .nextflow.log | grep -c 'Submitted process > foo'` == 1 ]] || false
[[ `grep 'INFO' .nextflow.log | grep -c 'Re-submitted process > foo'` == 3 ]] || false

[[ `grep -c 'mem: 8 GB (previous: 4294967296) (error: Process .* terminated with an error exit status (137))' stdout` == 1 ]] || false
[[ `grep -c 'mem: 8 GB (previous: 4294967296) (error: nextflow.exception.ProcessFailedException: Process .* terminated with an error exit status (137))' stdout` == 1 ]] || false


2 changes: 1 addition & 1 deletion tests/trace-access.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ process foo {
"""
} else {
"""
echo 'mem: $task.memory (previous: $task.previousTrace.memory) (error: $task.previousError)'
echo 'mem: $task.memory (previous: $task.previousTrace.memory) (error: $task.previousException)'
exit 0
"""
}
Expand Down

0 comments on commit 54e0442

Please sign in to comment.