Errors

This module contains all custom errors/exceptions.

CustomError A base class for all custom exceptions.
FatalError A custom exception for all errors that violate expected invariants.
GenerationError A custom exception for all errors that occur during generation.
IntegrityError A custom exception for all errors that occur because there are logical/ sematic errors in a profile written by the user.
PreconditionError A custom exception for all errors that occur due to preconditions or expectations that are not fullfilled.
UnkownError A custom exception for all errors that are not expected/unkown.
UserAbortion Used to abort uberdot at any given point safely by the user.
UserError A custom exception for all errors that occur because the user didn't used the program correctly.
exception errors.CustomError(message)

Bases: Exception

A base class for all custom exceptions.

_message

The original unformated error message

Type:str
message

The formatted colored error message

Type:str
EXITCODE

The exitcode that will be returned when this exception is raised. This needs to be implemented by subclasses.

__init__(message)

Constructor

Parameters:message (str) -- The error message
exception errors.FatalError(message='Unkown Error')

Bases: errors.CustomError

A custom exception for all errors that violate expected invariants.

EXITCODE = 69

The exitcode for a FatalError

__init__(message='Unkown Error')

Constructor.

Adds a disclaimer that this error is indeed really bad.

Parameters:message (str) -- The error message
exception errors.GenerationError(profile_name, message)

Bases: errors.CustomError

A custom exception for all errors that occur during generation.

Example:The profile has syntax errors or a dotfile can't be found.
EXITCODE = 104

The exitcode for a GenerationError

__init__(profile_name, message)

Constructor.

Adds the name of the profile that triggered the error to the message.

Parameters:
  • profile_name (str) -- Name of the profile that triggered the error
  • message (str) -- The error message
exception errors.IntegrityError(message)

Bases: errors.CustomError

A custom exception for all errors that occur because there are logical/ sematic errors in a profile written by the user.

Example:A link is defined multiple times with different targets.
EXITCODE = 102

The exitcode for a IntegrityError

exception errors.PreconditionError(message)

Bases: errors.CustomError

A custom exception for all errors that occur due to preconditions or expectations that are not fullfilled.

Example:A link that is defined in the installed-file doesn't exist on the system.
EXITCODE = 103

The exitcode for a PreconditionError

exception errors.SystemAbortion(message)

Bases: errors.CustomError

Used to abort uberdot by the system.

EXITCODE = 107

The exitcode for a SystemAbortion

exception errors.UnkownError(original_error, message)

Bases: errors.CustomError

A custom exception for all errors that are not expected/unkown.

Used in pokemon handlers of critical sections to convert all unexpected errors into CustomException.

EXITCODE = 105

The exitcode for a UnkownError

__init__(original_error, message)

Constructor.

Adds the type and the message of the original error to the error message.

Parameters:
  • original_error (Exception) -- The original exception that was catched
  • message (str) -- An additional message for context
exception errors.UserAbortion

Bases: errors.CustomError

Used to abort uberdot at any given point safely by the user.

EXITCODE = 106

The exitcode for a UserAbortion

__init__()

Constructor.

Sets the error message to "Aborted by user".

exception errors.UserError(message)

Bases: errors.CustomError

A custom exception for all errors that occur because the user didn't used the program correctly.

Example:--parent was specified without using -i.
EXITCODE = 101

The exitcode for a UserError

__init__(message)

Constructor.

Adds a hint how to show help.

Parameters:message (str) -- The error message