rename RequestCancelException to OperationCanceledException (#825)

This commit is contained in:
Victor Vazquez 2020-10-21 01:31:26 -07:00 committed by GitHub
parent 9d47db1d4a
commit 9c96688b6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

View File

@ -9,6 +9,7 @@
### New Features
- Added `strings.hpp` with `Azure::Core::Strings::LocaleInvariantCaseInsensitiveEqual` and `Azure::Core::Strings::ToLower`.
- Added `OperationCanceledException`.
### Other changes and Improvements
@ -32,6 +33,7 @@
- Throw Azure::Http::TransportException if creating new connection fails.
- Response objects store Nullable\<T\>.
- Calling `Cancel()` from context now throws `OperationCanceledException`.
### Bug Fixes

View File

@ -26,9 +26,9 @@ namespace Azure { namespace Core {
virtual ~ValueBase() {}
};
struct RequestCanceledException : public std::runtime_error
struct OperationCanceledException : public std::runtime_error
{
explicit RequestCanceledException(std::string const& msg) : std::runtime_error(msg) {}
explicit OperationCanceledException(std::string const& message) : std::runtime_error(message) {}
};
/**
@ -389,7 +389,7 @@ namespace Azure { namespace Core {
{
if (CancelWhen() < std::chrono::system_clock::now())
{
throw RequestCanceledException("Request was canceled by context.");
throw OperationCanceledException("Request was canceled by context.");
}
}
};

View File

@ -444,7 +444,7 @@ namespace Azure { namespace Core { namespace Test {
= Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Put, host, &stream);
// Request will be canceled from main thread throwing the exception
EXPECT_THROW(pipeline.Send(cancelThis, request), Azure::Core::RequestCanceledException);
EXPECT_THROW(pipeline.Send(cancelThis, request), Azure::Core::OperationCanceledException);
};
// Start request
@ -467,7 +467,7 @@ namespace Azure { namespace Core { namespace Test {
auto request = Azure::Core::Http::Request(Azure::Core::Http::HttpMethod::Get, host);
// Request will be canceled from main thread throwing the exception
EXPECT_THROW(pipeline.Send(cancelThis, request), Azure::Core::RequestCanceledException);
EXPECT_THROW(pipeline.Send(cancelThis, request), Azure::Core::OperationCanceledException);
};
// Start request