mthurmaier-hb opened a new issue, #56460:
URL: https://github.com/apache/airflow/issues/56460
### Description
The aforementioned REST endpoint returns a state but not an exit code.
state of "failed" doesn't indicate why a task failed. A POSIX status code,
e.g. 0-255, could.
It is not clear to me whether it belongs in the return for this endpoint or
whether we may need to extend the API by having:
GET:/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/statuses/{task_try_number}
like we have for logs to get the status code for each try, or both. I.e., if
Airflow gives up trying because the max tries is exceeded, then the status code
for the .../{task_id} can be the status code of the last try?
### Use case/motivation
When a task fails, I need a way to determine WHY it failed,
programmatically. It is very inconvenient to get the logs and then try to
parse them to find the error. A POSIX exit code is intended for just this
purpose, to give a number that can be used to indicate how or why something
failed, with 0 meaning the task / command / whatever succeeded.
### Related issues
not that I could find.
### Are you willing to submit a PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]