Exceptions

Every error raised by nexsci-rv inherits from NexsciRVError, so you can catch the whole package broadly with except NexsciRVError or handle a specific failure narrowly (for example, retrying after an AuthExpired). The errors carry descriptive messages and map to recoverable situations — a bad credential, an unsupported query on a given archive, or a server-side problem — rather than generic Python exceptions.

All exceptions raised by nexsci-rv derive from NexsciRVError. Catch broadly for “anything from this package,” or narrowly for a specific failure mode.

NexsciRVError
├── ConfigError
├── AuthError
│   ├── LoginFailed
│   ├── AuthExpired
│   └── NotAuthenticated
├── QueryError
│   ├── UnknownDataLevel
│   ├── UnknownColumn
│   ├── NotApplicable
│   └── TapServerError
├── DownloadError
├── FileUnavailable
└── AsyncJobError

Exception hierarchy for nexsci-rv.

User code can catch NexsciRVError to handle any error originating from this package. The narrower subclasses let callers distinguish auth issues from query problems from download failures.

exception nexsci_rv.exceptions.AsyncJobError

Bases: NexsciRVError

An async TAP job ended in error or aborted phase.

exception nexsci_rv.exceptions.AuthError

Bases: NexsciRVError

Base class for authentication-related errors.

exception nexsci_rv.exceptions.AuthExpired

Bases: AuthError

The server returned 401/403 with an existing cookie loaded.

Users should call archive.login() again. We deliberately do not silently re-login so that credentials are not held in memory.

exception nexsci_rv.exceptions.ConfigError

Bases: NexsciRVError

Invalid or missing configuration (bad server URL, unwritable cookie path, etc.).

exception nexsci_rv.exceptions.DownloadError(message, failures)

Bases: NexsciRVError

One or more files in a parallel download failed.

Parameters:
failures

list of (filename, underlying_exception) tuples for the files that failed. Successfully downloaded files are still returned to the caller; this exception is raised at the end so partial progress is preserved.

exception nexsci_rv.exceptions.FileUnavailable

Bases: NexsciRVError

The archive answered a file request with an error instead of the file.

The NEID download endpoint reports problems (file not available, invalid file handle) as a JSON body with HTTP 200, so this is detected from the response content rather than the status code.

exception nexsci_rv.exceptions.LoginFailed

Bases: AuthError

The login endpoint rejected the provided credentials.

exception nexsci_rv.exceptions.NexsciRVError

Bases: Exception

Root of the nexsci-rv exception hierarchy.

exception nexsci_rv.exceptions.NotApplicable

Bases: QueryError

The query method does not apply to this archive / data level.

Example: EXPRESArchive.query_position — EXPRES solar rows have sentinel qrad/qdecd values (-99.9) so position search returns nothing meaningful.

exception nexsci_rv.exceptions.NotAuthenticated

Bases: AuthError

An operation that requires login was attempted with no cookie present.

exception nexsci_rv.exceptions.QueryError

Bases: NexsciRVError

Base class for query-construction or query-execution errors.

exception nexsci_rv.exceptions.TapServerError

Bases: QueryError

The TAP server returned QUERY_STATUS=ERROR in a VOTable response.

exception nexsci_rv.exceptions.UnknownColumn

Bases: QueryError

A requested column is not present in the target table’s schema.

exception nexsci_rv.exceptions.UnknownDataLevel

Bases: QueryError

The requested data_level is not one of the archive’s known levels.