• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. RBTools 4.x
    2. Version 5.x
    3. Version 4.x
    4. Version 3.x
    5. Version 2.0
    6. Version 1.0
    7. Version 0.7
    8. Version 0.6
    9. Version 0.5
    10. RBTools Python API
    11. Module and Class References
    12. rbtools.api.errors
  • Home
  • Installing RBTools
  • rbt Command
  • Configuration
  • Authenticating to Review Board
  • Repository Configuration
  • Per-User Configuration
  • Team Foundation Server Configuration
  • Commands
  • alias
  • api-get
  • attach
  • clear-cache
  • close
  • diff
  • install
  • land
  • list-repo-types
  • login
  • logout
  • patch
  • post
  • publish
  • review
  • setup-completion
  • setup-repo
  • stamp
  • status
  • status-update
  • RBTools Workflows
  • Using RBTools With Cliosoft SOS
  • Using RBTools with Git
  • Using RBTools with HCL VersionVault and IBM ClearCase
  • Using RBTools With Perforce
  • RBTools Python API
  • Overview of the Python API Client
  • Tutorial
  • Resource-Specific Functionality
  • Module and Class References
  • rbtools
  • rbtools.deprecation
  • rbtools.api
  • rbtools.api.cache
  • rbtools.api.capabilities
  • rbtools.api.client
  • rbtools.api.decode
  • rbtools.api.decorators
  • rbtools.api.errors
  • rbtools.api.factory
  • rbtools.api.request
  • rbtools.api.resource
  • rbtools.api.transport
  • rbtools.api.transport.sync
  • rbtools.api.utils
  • rbtools.clients
  • rbtools.clients.base
  • rbtools.clients.base.patch
  • rbtools.clients.base.registry
  • rbtools.clients.base.repository
  • rbtools.clients.base.scmclient
  • rbtools.clients.errors
  • rbtools.clients.bazaar
  • rbtools.clients.clearcase
  • rbtools.clients.cvs
  • rbtools.clients.git
  • rbtools.clients.mercurial
  • rbtools.clients.perforce
  • rbtools.clients.plastic
  • rbtools.clients.sos
  • rbtools.clients.svn
  • rbtools.clients.tfs
  • rbtools.diffs
  • rbtools.diffs.tools
  • rbtools.diffs.tools.backends
  • rbtools.diffs.tools.backends.gnu
  • rbtools.diffs.tools.base
  • rbtools.diffs.tools.base.diff_file_result
  • rbtools.diffs.tools.base.diff_tool
  • rbtools.diffs.tools.errors
  • rbtools.diffs.tools.registry
  • rbtools.diffs.writers
  • rbtools.commands
  • rbtools.commands.main
  • rbtools.commands.alias
  • rbtools.commands.api_get
  • rbtools.commands.attach
  • rbtools.commands.clearcache
  • rbtools.commands.close
  • rbtools.commands.diff
  • rbtools.commands.info
  • rbtools.commands.install
  • rbtools.commands.land
  • rbtools.commands.list_repo_types
  • rbtools.commands.login
  • rbtools.commands.logout
  • rbtools.commands.patch
  • rbtools.commands.post
  • rbtools.commands.publish
  • rbtools.commands.review
  • rbtools.commands.setup_completion
  • rbtools.commands.setup_repo
  • rbtools.commands.stamp
  • rbtools.commands.status
  • rbtools.commands.status_update
  • rbtools.hooks
  • rbtools.hooks.common
  • rbtools.hooks.git
  • rbtools.testing
  • rbtools.testing.api
  • rbtools.testing.api.payloads
  • rbtools.testing.api.transport
  • rbtools.testing.commands
  • rbtools.testing.testcase
  • rbtools.testing.transport
  • rbtools.utils
  • rbtools.utils.aliases
  • rbtools.utils.checks
  • rbtools.utils.commands
  • rbtools.utils.console
  • rbtools.utils.diffs
  • rbtools.utils.encoding
  • rbtools.utils.errors
  • rbtools.utils.filesystem
  • rbtools.utils.graphs
  • rbtools.utils.match_score
  • rbtools.utils.process
  • rbtools.utils.repository
  • rbtools.utils.review_request
  • rbtools.utils.source_tree
  • rbtools.utils.testbase
  • rbtools.utils.users
  • Glossary
  • General Index
  • Python Module Index
  • Release Notes
  • This documentation covers RBTools 4.x. You can select a version above or view the latest documentation.

    rbtools.api.errors¶

    Error classes and codes for API communication.

    Functions

    create_api_error(http_status, *args, **kwargs)

    Create an error instance.

    Exceptions

    APIError([http_status, error_code, rsp, message])

    An error communicating with the API.

    AuthorizationError([http_status, ...])

    Authorization error when communicating with the API.

    BadRequestError([http_status, error_code, ...])

    Bad request data made to an API.

    CacheError

    An exception for caching errors.

    ServerInterfaceError(msg, *args, **kwargs)

    A non-API error when communicating with a server.

    ServerInterfaceSSLError(*, host, port, ...)

    An error communicating over SSL or verifying an SSL certificate.

    exception rbtools.api.errors.APIError(http_status: Optional[int] = None, error_code: Optional[int] = None, rsp: Optional[Dict] = None, message: Optional[str] = None, *args, **kwargs)[source]¶

    Bases: Exception

    An error communicating with the API.

    error_code¶

    The API error code. This may be None.

    Type:

    int

    http_status¶

    The HTTP status code.

    Type:

    int

    message¶

    The error message from the API response. This may be None.

    New in version 3.1.

    Type:

    str

    rsp¶

    The API response payload. This may be None.

    Type:

    dict

    default_message: str = 'An error occurred when communicating with Review Board.'¶

    The default error message used if a specific error is not available.

    New in version 3.1.

    Type:

    str

    __init__(http_status: Optional[int] = None, error_code: Optional[int] = None, rsp: Optional[Dict] = None, message: Optional[str] = None, *args, **kwargs) → None[source]¶

    Initialize the error.

    Parameters:
    • http_status (int, optional) –

      The HTTP status code associated with this error.

      Changed in version 3.1: This is now optional.

    • error_code (int, optional) –

      The API error code associated with this error.

      Changed in version 3.1: This is now optional.

    • rsp (dict, optional) – The API response payload. This may be None for non-API Error payloads.

    • message (str, optional) –

      A specific error message to use. This will take precedence over any errors in rsp.

      New in version 3.1.

    • *args (tuple) – Extra positional arguments to pass to the base constructor.

    • **kwargs (dict) – Extra keyword arguments to pass to the base constructor.

    __str__() → str[source]¶

    Return a string representation of the error.

    The explicit message passed to the constructor will be used if provided. If not provided, this will fall back to the message in the rsp payload, or to default_message.

    If an API error code is available, it will be included in the message. If one is not provided, but an HTTP status is available, then it will be included instead.

    Returns:

    The error message.

    Return type:

    str

    exception rbtools.api.errors.AuthorizationError(http_status: Optional[int] = None, error_code: Optional[int] = None, rsp: Optional[Dict] = None, message: Optional[str] = None, *args, **kwargs)[source]¶

    Bases: APIError

    Authorization error when communicating with the API.

    default_message: str = 'Error authenticating to Review Board.'¶

    The default error message used if a specific error is not available.

    New in version 3.1.

    Type:

    str

    exception rbtools.api.errors.BadRequestError(http_status: Optional[int] = None, error_code: Optional[int] = None, rsp: Optional[Dict] = None, message: Optional[str] = None, *args, **kwargs)[source]¶

    Bases: APIError

    Bad request data made to an API.

    default_message: str = 'Missing or invalid data was sent to Review Board.'¶

    The default error message used if a specific error is not available.

    New in version 3.1.

    Type:

    str

    __str__() → str[source]¶

    Return a string representation of the error.

    If the payload contains a list of fields, the error associated with each field will be included.

    Returns:

    The error message.

    Return type:

    str

    exception rbtools.api.errors.CacheError[source]¶

    Bases: Exception

    An exception for caching errors.

    exception rbtools.api.errors.ServerInterfaceError(msg: str, *args, **kwargs)[source]¶

    Bases: Exception

    A non-API error when communicating with a server.

    __init__(msg: str, *args, **kwargs) → None[source]¶

    Initialize the error.

    Parameters:
    • msg (str) – The error’s message.

    • *args (tuple) – Positional arguments to pass through to the base class.

    • **kwargs (dict) – Keyword arguments to pass through to the base class.

    __str__() → str[source]¶

    Return the error message as a unicode string.

    Returns:

    The error message as a unicode string.

    Return type:

    str

    exception rbtools.api.errors.ServerInterfaceSSLError(*, host: str, port: int, ssl_error: SSLError, ssl_context: SSLContext)[source]¶

    Bases: ServerInterfaceError

    An error communicating over SSL or verifying an SSL certificate.

    This class wraps a ssl.SSLError or subclass, and attempts to generate a helpful error message with instructions for resolving most common SSL-related issues.

    New in version 4.1.

    __init__(*, host: str, port: int, ssl_error: SSLError, ssl_context: SSLContext) → None[source]¶

    Initialize the error.

    Parameters:
    • host (str) – The hostname RBTools attempted to connect to.

    • port (int) – The port RBTools attempted to connect to.

    • ssl_error (ssl.SSLError) – The original SSL error.

    • ssl_context (ssl.SSLContext) – The original SSL context.

    host: str¶

    The hostname RBTools attempted to connect to.

    port: int¶

    The port RBTools attempted to connect to.

    ssl_error: SSLError¶

    The original SSL error.

    ssl_context: SSLContext¶
    rbtools.api.errors.create_api_error(http_status: int, *args, **kwargs) → APIError[source]¶

    Create an error instance.

    Parameters:
    • http_status (int) – The HTTP status code.

    • *args (tuple) – Positional arguments to pass through to the error class.

    • **kwargs (dict) – Keyword arguments to pass through to the error class.

    Returns:

    The error instance.

    Return type:

    APIError

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2025 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]