upsies.errors

Exception classes

Abstraction layers should raise one of these exceptions if an error message should be displayed to the user. If the programmer made a mistake, any appropriate builtin exception (e.g. ValueError, TypeError) or RuntimeError should be raised.

For example, get() always raises RequestError, regardless of which library is used or what went wrong, except when something like caching fails, which is most likely due to a bug.

Functions

upsies.errors.DaemonProcessError(exception, original_traceback)[source]

Exception from a DaemonProcess target

This exception has an original_traceback attribute that provides the trace of the exception.

Exceptions

exception upsies.errors.AnnounceUrlNotSetError(*_, tracker)[source]

Announce URL is required but not provided by the user

exception upsies.errors.BannedGroup(group, additional_info=None)[source]

Raised by BannedGroup.check() if release group is banned

exception upsies.errors.ConfigError[source]

Error while reading/writing config file or setting config file option

exception upsies.errors.ConfigValueError(message, *, path=())[source]

Configuration option is set to an invalid value

exception upsies.errors.ContentError[source]

Something is wrong with user-provided content, e.g. no video files in the given directory or no permission to read

exception upsies.errors.DaemonProcessTerminated[source]

Raised by a DaemonProcess target if it received terminate

exception upsies.errors.DependencyError[source]

Some external tool is missing (e.g. mediainfo)

exception upsies.errors.FoundDupeError(filenames)[source]

Tried to upload files that have already been uploaded

Parameters:

filenames – Sequence of file names that have already been uploaded

exception upsies.errors.ImageConvertError[source]

Image optimization failed

exception upsies.errors.ImageError[source]

Any errors related to image creation or manipulation

exception upsies.errors.ImageOptimizeError[source]

Image optimization failed

exception upsies.errors.ImageResizeError[source]

Image resizing failed

exception upsies.errors.ProcessError[source]

Executing subprocess failed

exception upsies.errors.RequestError(msg, url='', headers={}, status_code=None, text='')[source]

Network request failed

exception upsies.errors.RequestedNotFoundError(requested)[source]

Something was requested and not found

This is different from a RequestError that was raised because the service is down, authentication failed, etc.

Parameters:

requested – Human-readable representation of the requested thing.

exception upsies.errors.RuleBroken(reason)[source]

Raised by TrackerRuleBase.check() if a rule is broken

exception upsies.errors.SceneAbbreviatedFilenameError(file_name)[source]

An abbreviated scene file name (e.g. foo-bar.mkv) was provided

These contain almost no information and should always be provided via a properly named parent directory.

exception upsies.errors.SceneError[source]

Base class for scene-related errors

exception upsies.errors.SceneFileSizeError(filename, *, original_size, existing_size)[source]

Scene release file size differs from original release

exception upsies.errors.SceneMissingInfoError(file_name)[source]

Missing information about a file from a scene release

exception upsies.errors.SceneRenamedError(*, original_name, existing_name)[source]

Renamed scene release

exception upsies.errors.ScreenshotError[source]

Screenshot creation failed

exception upsies.errors.TfaRequired[source]

Raised by TrackerBase._login() if 2FA one-time password is required

exception upsies.errors.TimeoutError(seconds, *, resource=None)[source]

Raised when something took too long

Parameters:
  • seconds – How many seconds we waited before giving up

  • resource – What we were waiting for (e.g. URL)

exception upsies.errors.TorrentAddError[source]

Adding torrent to client failed

exception upsies.errors.TorrentCreateError[source]

Torrent file creation failed

exception upsies.errors.UiError[source]

Fatal user interface error that cannot be handled by the UI itself

exception upsies.errors.UnknownConfigError(name)[source]

Unknown section, subsection or option accessed

Because this exception is raised in __getitem__ methods, it is a subclass of KeyError. That means the error message is quoted because it is supposed to be a key. An actual error message is available via the message attribute. Likewise, the section, subsection or option name is available as name.

exception upsies.errors.UnknownOptionConfigError(option_name)[source]

Unknown option accessed (see UnknownConfigError)

exception upsies.errors.UnknownSectionConfigError(section_name)[source]

Unknown section accessed (see UnknownConfigError)

exception upsies.errors.UnknownSubsectionConfigError(subsection_name)[source]

Unknown subsection accessed (see UnknownConfigError)

exception upsies.errors.UpsiesError[source]

Base class for all exceptions raised by upsies

exception upsies.errors.ValueError[source]

Invalid or otherwise bad value