job.error package

Submodules

job.error.error module

Defines the class for representing a job error

class job.error.error.JobError(job_type_name, name, title=None, description=None, category=u'ALGORITHM')

Bases: object

Represents a job error that would appear in a job type’s error mapping

create_model()

Creates an error model representing this job error

Returns:The error model
Return type:error.models.Error

job.error.mapping module

Defines the class for handling the error mapping for a job type

class job.error.mapping.JobErrorMapping(job_type_name)

Bases: object

Handles the error mapping for a job type

add_mapping(exit_code, error)

Adds a mapping from the given exit code to the given error

Parameters:
get_error(exit_code=None, default_error_name=u'algorithm-unknown')

Retrieves the error model that maps to the given exit code. If the exit code is zero (success), None is returned. For a failure exit code with no mapping, the given default error is returned.

Parameters:
  • exit_code (int) – The exit code from a task
  • default_error_name (string) – The name of the builtin error to use if no mapping exists for the exit code
Returns:

The error model mapped to the given exit code, possibly None

Return type:

error.models.Error

save_models()

Saves this mapping as error models in the database

Module contents