Skip to content

Conversation

@rohan-varma
Copy link
Contributor

@rohan-varma rohan-varma commented Nov 11, 2019

Stack from ghstack:

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

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]
rohan-varma added a commit that referenced this pull request Nov 11, 2019
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
Copy link
Contributor

@zhaojuanmao zhaojuanmao left a 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]

// create an exception given a message and exception.
TORCH_API Message
createException(const Message& request, const std::exception& e);
Copy link
Contributor

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]
rohan-varma added a commit that referenced this pull request Nov 12, 2019
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]
rohan-varma added a commit that referenced this pull request Nov 12, 2019
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(
Copy link
Contributor

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?

Copy link
Contributor Author

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]
rohan-varma added a commit that referenced this pull request Nov 13, 2019
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]
rohan-varma added a commit that referenced this pull request Nov 13, 2019
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/)
@rohan-varma
Copy link
Contributor Author

The CI failures are unrelated, will proceed with landing this

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 3fb9bbc.

@facebook-github-bot facebook-github-bot deleted the gh/rohan-varma/30/head branch November 17, 2019 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants