Errors

class APIError(r)[source]

The APIError Exception is a generic Exception for handling responses from the API that aren’t what’s expected. The APIError Exception itself attempts to provide the developer with enough information around the response to ascertain what went wrong.

code

The HTTP response code from the offending response.

Type:int
response

This is the Response object that had caused the Exception to fire.

Type:request.Response
uuid

The Request UUID of the request. This can be used for the purpose of tracking the request and the response through the Tenable.io infrastructure. In the case of Non-Tenable.io products, is simply an empty string.

Type:str
class ConnectionError(msg)[source]

A connection-error is thrown only for products like Tenable.sc or Nessus, where the application may be installed anywhere. This error is thrown if we are unable to complete the initial connection or gather the basic information about the application that is necessary.

class ImpersonationError(r)[source]

An ImpersonationError exists when there is an issue with user impersonation.

code

The HTTP response code from the offending response.

Type:int
response

This is the Response object that had caused the Exception to fire.

Type:request.Response
uuid

The Request UUID of the request. This can be used for the purpose of tracking the request and the response through the Tenable.io infrastructure. In the case of Non-Tenable.io products, is simply an empty string.

Type:str
class NotFoundError(r)[source]

A NotFoundError Exception is thrown when the requested object either doesn’t exist, or cannot be retrieved. The HTTP response code generally associated to this Exception is 404.

code

The HTTP response code from the offending response.

Type:int
response

This is the Response object that had caused the Exception to fire.

Type:request.Response
uuid

The Request UUID of the request. This can be used for the purpose of tracking the request and the response through the Tenable.io infrastructure. In the case of Non-Tenable.io products, is simply an empty string.

Type:str
class PackageMissingError(msg)[source]

In situations where an optional library is needed, this exception will be thrown if the optional library is needed, however is unavailable.

class PasswordComplexityError(r)[source]

PasswordComplexityError is thrown when attempting to change a password and the password complexity is insufficient.

code

The HTTP response code from the offending response.

Type:int
response

This is the Response object that had caused the Exception to fire.

Type:request.Response
uuid

The Request UUID of the request. This can be used for the purpose of tracking the request and the response through the Tenable.io infrastructure. In the case of Non-Tenable.io products, is simply an empty string.

Type:str
class RetryError(r, attempts)[source]

A RetryError is thrown when too many retry attempts have been made.

code

The HTTP response code from the offending response.

Type:int
response

This is the Response object that had caused the Exception to fire.

Type:request.Response
uuid

The Request UUID of the request. This can be used for the purpose of tracking the request and the response through the Tenable.io infrastructure. In the case of Non-Tenable.io products, is simply an empty string.

Type:str
attempts

The number of attempts that were made before bailing.

Type:int
class ServerError(r)[source]

A ServerError is thrown when the HTTP request cannot be completed due to a server-side issue. The HTTP response code generally associated to this Exception is 500.

code

The HTTP response code from the offending response.

Type:int
response

This is the Response object that had caused the Exception to fire.

Type:request.Response
uuid

The Request UUID of the request. This can be used for the purpose of tracking the request and the response through the Tenable.io infrastructure. In the case of Non-Tenable.io products, is simply an empty string.

Type:str
class TenableException(msg)[source]

Base exception class that sets up logging and handles some basic scaffolding for all other exception classes. This exception should never be directly seen.

class TioExportsError(export, uuid)[source]

When the exports APIs throw an error when processing an export, pyTenable will throw this error in turn to relay that context to the user.

class TioExportsTimeout(export, uuid)[source]

When an export has been cancelled due to timeout, this error is thrown.

class UnexpectedValueError(msg)[source]

An unexpected value error is thrown whenever the value specified for a parameter is outside the bounds of what is expected. For example, if the parameter a is expected to have a value of 1, 2, or 3, and it is instead passed a value of 0, then it is an unexpected value, and this Exception should be thrown by the package.

class UnknownError(r)[source]

If the package is unable to determine what categorization the Exception should fall under, it will fall back to this Exception type. We should generally not see UnknownError be thrown.

code

The HTTP response code from the offending response.

Type:int
response

This is the Response object that had caused the Exception to fire.

Type:request.Response
uuid

The Request UUID of the request. This can be used for the purpose of tracking the request and the response through the Tenable.io infrastructure. In the case of Non-Tenable.io products, is simply an empty string.

Type:str
class UnsupportedError(r)[source]

UnsupportedError is thrown when an unsupported call is thrown. The HTTP response code generally associated to this Exception is 409.

code

The HTTP response code from the offending response.

Type:int
response

This is the Response object that had caused the Exception to fire.

Type:request.Response
uuid

The Request UUID of the request. This can be used for the purpose of tracking the request and the response through the Tenable.io infrastructure. In the case of Non-Tenable.io products, is simply an empty string.

Type:str