# Module `netapp_ontap.error`

Copyright © 2020 NetApp Inc. All rights reserved.

This module defines the custom exception type. All exceptions raised by the library descend from this type.

## Classes

`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.

  ## Args

  `message`
    A human readable message that explains the error.
  `cause`
    An exception object that caused this exception to be raised.

  ### Ancestors

  - builtins.Exception
  - builtins.BaseException

  ### Instance variables

  `http_err_response`

    Describes a response to an API request that contains an error.

    ## Returns

    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.