update exceptions to be a class instead of an struct (#833)

Fixes: https://github.com/Azure/azure-sdk-for-cpp/issues/828
This commit is contained in:
Victor Vazquez 2020-10-21 19:53:46 -07:00 committed by GitHub
parent 64ddc30abd
commit 5d0e7734c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 8 deletions

View File

@ -14,6 +14,7 @@
### Other changes and Improvements
- Add high-level and simplified core.hpp file for simpler include experience for customers.
- Update SDK-defined exception types to be classes instead of structs.
### Bug Fixes

View File

@ -26,8 +26,17 @@ namespace Azure { namespace Core {
virtual ~ValueBase() {}
};
struct OperationCanceledException : public std::runtime_error
{
/**
* @brief An exception that gets thrown when some operation is canceled.
*
*/
class OperationCanceledException : public std::runtime_error {
public:
/**
* @brief Construct with message string as description.
*
* @param message The description for the exception.
*/
explicit OperationCanceledException(std::string const& message) : std::runtime_error(message) {}
};

View File

@ -15,8 +15,8 @@ namespace Azure { namespace Core {
* @brief An error while trying to send a request to Azure service.
*
*/
struct RequestFailedException : public std::runtime_error
{
class RequestFailedException : public std::runtime_error {
public:
/**
* @brief Construct a new Request Failed Exception object.
*

View File

@ -52,8 +52,8 @@ namespace Azure { namespace Core { namespace Http {
/**
* @brief HTTP transport layer error.
*/
struct TransportException : public Azure::Core::RequestFailedException
{
class TransportException : public Azure::Core::RequestFailedException {
public:
/**
* @brief An error while sending the HTTP request with the transport adapter.
*
@ -72,8 +72,8 @@ namespace Azure { namespace Core { namespace Http {
* @brief An invalid header key name in @Request or @RawResponse.
*
*/
struct InvalidHeaderException : public Azure::Core::RequestFailedException
{
class InvalidHeaderException : public Azure::Core::RequestFailedException {
public:
/**
* @brief An invalid header key name detected in the HTTP request or response.
*