errors: migrate handful of errors to SnapcraftException
- Add SnapcraftReportableException helper class for reportable
errors, which simply flips the default value for get_reportable().
- Convert MissingStateClean, StepOutdatedError,
SnapcraftEnvironmentError, SnapcraftDataDirectoryMissingError,
and SnapcraftMissingLinkerInBaseError and associated tests.
- Add missing test for SnapcraftDataDirectoryMissingError.
- Update tests to verify expected "reportable" value as well.
- Drop `dependents` from StepOutdatedError. It's unused in the
codebase. Drop associated test as well.
- Add CLEAN_RESOLUTION string to share commonly used clean/retry msg.
The error messages are being shortened and I am also using
this opportunity to simplify them (and the resolution messages).
For example, when StepOutdatedError occurs, instead of suggesting
that the user clean just one part/step when something is out of date,
ask them to instead clean the whole project. Something unusual has
happened and it's probably a good idea to clean the whole tree. Use
introduced CLEAN_RESOLUTION for this.
Adding type checking as well to converted exceptions.
Signed-off-by: Chris Patterson <email address hidden>
This PR extracts title and version from AppStream's name tag and
from the version property of the first release tag.
According to the AppStream docs:
> name: A human-readable name for this software component. For
> example, if the component ID was "libc", its name might be
> "GNU Standard C Library".
> Each release of the software component should have a <release/>
> tag describing it, but at least one release child must be present
> for the current release of the software. The release children
> should be sorted in a latest-to-oldest order to simplify reading
> the metadata file.