ppa-dev-tools:error-handling-cleanup

Last commit made on 2024-03-11
Get this branch:
git clone -b error-handling-cleanup https://git.launchpad.net/ppa-dev-tools
Only Bryce Harrington can upload to this branch. If you are Bryce Harrington please log in for upload directions.

Branch merges

Branch information

Name:
error-handling-cleanup
Repository:
lp:ppa-dev-tools

Recent commits

03b736c... by Bryce Harrington

ppa: Catch exceptions for issues when reading config files

I'm intentionally forcing the exception object to a str in the f-string.
I've found that YAMLError's exception object can be a bit over detailed,
but the str() representation gives it in a human-readable form.

f6ae4f0... by Bryce Harrington

ppa: Use standard error codes for exit conditions

EX_USAGE on errors in how the tool is used
EX_UNAVAILABLE for Launchpad service unavailability
EX_CANTCREAT if a new PPA can't be created in Launchpad
EX_NOTFOUND if an existing PPA isn't found in Launchpad

For user interrupt, there doesn't seem to be a standard Python error
code, but 130 seems to be a common value for Bash[0, 1], so I've added
it defined locally as EX_KEYBOARD_INTERRUPT.

0: https://tldp.org/LDP/abs/html/exitcodes.html
1: https://stackoverflow.com/questions/21120947/catching-keyboardinterrupt-in-python-during-program-shutdown

squash 130

3b056c2... by Bryce Harrington

Rename exception to PpaNotFoundError

Python's standard exceptions tend to be given names ending in Error,
such as ModuleNotFoundError, FileNotFoundError, etc. The official docs
also recommend[0] that user-defined exceptions be derived from the
Exception class, rather than BaseException.

0: https://docs.python.org/3/library/exceptions.html#base-classes

1a457e7... by Bryce Harrington

results: Fix invalid url generation for get_results()

Ensure that the url is constructed with '/' between components.

374b06a... by Bryce Harrington

tests: Implement test_get_results()

Fix some technical debt in the form of a missing test case. During
implementation it is discovered that there's a bug in how get_results
generates the url for the Result.

c592620... by Bryce Harrington

trigger: Improve Trigger class docs

bd0ad53... by Bryce Harrington

trigger: Rename series_codename to just series

e2aad71... by Bryce Harrington

trigger: Refactor trigger display logic to new show_triggers()

Similar to recent refactoring work extracting show_results,
show_waiting, and show_running, the logic for triggers is also moved out
to its own show_triggers() routine.

This one differs in semantics somewhat in that rather than operating on
all data, it only operates on a single source package at a time. This
is in preparation for enabling richer filtering of the list of triggers
when a PPA contains multiple packages or when rdepends are shown. For
now though, this simply iterates through all the source publications.

ff2d50f... by Bryce Harrington

trigger: Refactor object generation into new get_triggers()

Similar to past refactoring, this also moves the list comprehension into
a routine in the trigger module. For consistency with get_results() and
other routines, this is restructured to return an iterator rather than a
list. And similar to show_triggers(), the semantics focuses on
triggers for a single source package at a time.

89803d7... by Bryce Harrington

processes: Include output when raising ReturnCode

[Sync up with pdbq]