ray
ray copied to clipboard
[Core] Handle `TypeError` when `RayTaskError.cause` is a `BaseExceptionGroup`
Why are these changes needed?
TypeError can be raised from __new__ when the cause is a BaseExceptionGroup. Therefore, this PR moves the instantiation into the try block so that TypeError raised from __new__ can be handled.
Related issue number
Closes https://github.com/ray-project/ray/issues/45520
Checks
- [x] I've signed off every commit(by using the -s flag, i.e.,
git commit -s) in this PR. - [x] I've run
scripts/format.shto lint the changes in this PR. - [ ] I've included any doc changes needed for https://docs.ray.io/en/master/.
- [ ] I've added any new APIs to the API Reference. For example, if I added a
method in Tune, I've added it in
doc/source/tune/api/under the corresponding.rstfile.
- [ ] I've added any new APIs to the API Reference. For example, if I added a
method in Tune, I've added it in
- [x] I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
- Testing Strategy
- [ ] Unit tests
- [ ] Release tests
- [x] This PR is not tested :(
cc @jjyao to take a look and merge. Also we may want to support ExceptionGroups later.
@rynewang As follow-up, we need to add tests and properly support BaseExceptionGroup