-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[rpc] refactor and move createException function #29605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds a wrapper around the existing createException function that allows passing of an error string, instead of a regular C++ exception. This allows us to createExceptions for errors that aren't necessarilu c++ exceptions. This function is used by #29601 and #26336. Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/) [ghstack-poisoned]
Adds a wrapper around the existing createException function that allows passing of an error string, instead of a regular C++ exception. This allows us to createExceptions for errors that aren't necessarilu c++ exceptions. This function is used by #29601 and #26336. Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/) ghstack-source-id: 93682482 Pull Request resolved: #29605
zhaojuanmao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! please land it after tests are green
Adds a wrapper around the existing `createException` function that allows passing of an error string, instead of a regular C++ exception. This allows us to mark futures with exceptions for errors that aren't necessarily c++ exceptions. This function is used by #29601 and #26336. Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/) [ghstack-poisoned]
torch/csrc/distributed/rpc/message.h
Outdated
|
|
||
| // create an exception given a message and exception. | ||
| TORCH_API Message | ||
| createException(const Message& request, const std::exception& e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Maybe we should call this createExceptionResponse and clearly state in the docs that we're building a response Message with an exception for the provided request Message.
Adds a wrapper around the existing `createException` function that allows passing of an error string, instead of a regular C++ exception. This allows us to mark futures with exceptions for errors that aren't necessarily c++ exceptions. This function is used by #29601 and #26336. Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/) [ghstack-poisoned]
Adds a wrapper around the existing `createException` function that allows passing of an error string, instead of a regular C++ exception. This allows us to mark futures with exceptions for errors that aren't necessarily c++ exceptions. This function is used by #29601 and #26336. Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/) [ghstack-poisoned]
Pull Request resolved: #29605 Adds a wrapper around the existing createException function that allows passing of an error string, instead of a regular C++ exception. This allows us to createExceptions for errors that aren't necessarilu c++ exceptions. This function is used by #29601 and #26336. ghstack-source-id: 93705275 Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/)
Adds a wrapper around the existing `createException` function that allows passing of an error string, instead of a regular C++ exception. This allows us to mark futures with exceptions for errors that aren't necessarily c++ exceptions. This function is used by #29601 and #26336. Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/) [ghstack-poisoned]
Pull Request resolved: #29605 Adds a wrapper around the existing createException function that allows passing of an error string, instead of a regular C++ exception. This allows us to createExceptions for errors that aren't necessarilu c++ exceptions. This function is used by #29601 and #26336. ghstack-source-id: 93764993 Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/)
|
|
||
| // Create a response Message with an exception type for the provided request | ||
| // message. The passed in string will be used as the created message's payload | ||
| TORCH_API Message createExceptionResponse( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look like this method is used directly. Is there a reason we have this method? If not, can we remove it and only have one createExceptionResponse method for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am planning on using them in the 2 PRs I have linked in the description, so I just added it here to remove it from the other 2.
Adds a wrapper around the existing `createException` function that allows passing of an error string, instead of a regular C++ exception. This allows us to mark futures with exceptions for errors that aren't necessarily c++ exceptions. This function is used by #29601 and #26336. Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/) [ghstack-poisoned]
Pull Request resolved: #29605 Adds a wrapper around the existing createException function that allows passing of an error string, instead of a regular C++ exception. This allows us to createExceptions for errors that aren't necessarilu c++ exceptions. This function is used by #29601 and #26336. ghstack-source-id: 93803072 Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/)
Adds a wrapper around the existing `createException` function that allows passing of an error string, instead of a regular C++ exception. This allows us to mark futures with exceptions for errors that aren't necessarily c++ exceptions. This function is used by #29601 and #26336. Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/) [ghstack-poisoned]
Pull Request resolved: #29605 Adds a wrapper around the existing createException function that allows passing of an error string, instead of a regular C++ exception. This allows us to createExceptions for errors that aren't necessarilu c++ exceptions. This function is used by #29601 and #26336. ghstack-source-id: 93819039 Differential Revision: [D18439216](https://our.internmc.facebook.com/intern/diff/D18439216/)
|
The CI failures are unrelated, will proceed with landing this |
|
This pull request has been merged in 3fb9bbc. |
Stack from ghstack:
Adds a wrapper around the existing
createExceptionfunction thatallows passing of an error string, instead of a regular C++ exception. This
allows us to mark futures with exceptions for errors that aren't necessarily c++
exceptions. This function is used by
#29601 and #26336.
Differential Revision: D18439216