Skip to content

apkg errors

apkg communicates errors using custom exceptions in apkg/ex.py.

Each exception contains message explaining what went wrong as well as exit_code to return in case it's raised during CLI run.

A list of all apkg errors/exceptions with their default error message sorted by exit code:

ApkgException

An unknown error occurred

exit code: 1

InvalidUsage

Invalid usage: %(fail)s

exit code: 10

InvalidInput

Invalid input: %(fail)s

exit code: 11

InvalidType

Invalid type: $(var) must be %(desired)s but is %(type)s

exit code: 12

InvalidChoice

Invalid choice: %(var)s must be one of: %(opts)s (is: %(val)s)

exit code: 13

InvalidVersion

Invalid version: %(ver)s

exit code: 14

InvalidFormat

Invalid format: %(fmt)s

exit code: 16

InvalidArchiveFormat

Invalid archive format: %(fmt)s

exit code: 17

InvalidSourcePackageFormat

Invalid source package format: %(fmt)s

exit code: 18

InvalidCompatLevel

Project compat level %(proj)s is newer than current apkg compat level %(apkg)s.

Run `apkg compat` for more information.

Please upgrade apkg to work with this project.

exit code: 20

MissingRequiredArgument

Missing required argument: %(arg)s

exit code: 30

MissingRequiredConfigOption

Missing required config option: %(opt)s

exit code: 31

MissingPackagingTemplate

Missing package template: %(temp)s

exit code: 32

ArchiveNotFound

%(type)s archive not found: %(ar)s

exit code: 36

SourcePackageNotFound

%(type)s source package not found: %(srcpkg)s

exit code: 37

ParsingFailed

Unable to parse: %(fail)s

exit code: 42

FileDownloadFailed

Failed to download file with code %(code)s:

%(url)s

exit code: 52

CommandNotFound

Command not found: %(cmd)s

exit code: 60

CommandFailed

Command failed: %(cmd)s

exit code: 62

UnexpectedCommandOutput

Unexpected command output: %(out)s

exit code: 64

DistroNotSupported

Distro not supported: %(distro)s

exit code: 70

UnableToDetectUpstreamVersion

Unable to detect upstream version.

Please consider one of following:

1) set upstream.archive_url
2) set upstream.version_script to custom script
3) manually supply version using -v/--version option

exit code: 84