swh.deposit.errors module#
Module in charge of providing the standard sword errors
- exception swh.deposit.errors.ParserError[source]#
Bases:
ValueError
Specific parsing error detected when parsing the xml metadata input
- swh.deposit.errors.make_error_dict(key, summary=None, verbose_description=None)[source]#
Utility function to factorize error message dictionary.
- Parameters:
key (str) – Error status key referenced in swh.deposit.errors module
summary (str/None) – Error message clarifying the status
verbose_description (str/None) – A more verbose description or work around a potential problem.
- Returns:
Dictionary with key ‘error’ detailing the ‘status’ and associated ‘message’
- swh.deposit.errors.make_error_response_from_dict(req, error)[source]#
Utility function to return an http response with error detail.
- swh.deposit.errors.make_error_response(req, key, summary=None, verbose_description=None)[source]#
Utility function to create an http response with detailed error.
- Parameters:
- Returns:
Dictionary with key ‘error’ detailing the ‘status’ and associated ‘message’
- exception swh.deposit.errors.DepositError(key, summary, verbose_description=None)[source]#
Bases:
ValueError
Represents an error that should be reported to the client