Copyright © 2021 NetApp Inc. All rights reserved.
This module defines the custom exception type. All exceptions raised by the library descend from this type.
class NetAppRestError (message: str = None, cause: Exception = None)
Common base class for all exceptions raised by the library functions. All custom exceptions are derived from this type.
Initalize the error object.
Optionally accepts a custom message and cause. If provided, the cause is the exception object that was handled when this exception is created.
- A human readable message that explains the error.
- An exception object that caused this exception to be raised.
Describes a response to an API request that contains an error.
Response object if the exception was raised because of an API failure (HTTP status code of 400 or higher). None if the exception was not related to an API error.
Return the HTTP response body if this error was generated from a failed HTTP request. The body will be in dictionary form. If this exception is not from a failed request or the body cannot be parsed as JSON, returns None
Return the HTTP response body if this error was generated from a failed HTTP request. This will be the raw text of the response body. This is useful when the response body cannot be parsed as JSON.
Return the status code of the HTTP response if this error was generated from a failed HTTP request. Otherwise, returns None