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:
parent
64ddc30abd
commit
5d0e7734c4
@ -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
|
||||
|
||||
|
||||
@ -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) {}
|
||||
};
|
||||
|
||||
|
||||
@ -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.
|
||||
*
|
||||
|
||||
@ -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.
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user