Add new exceptions

This commit is contained in:
Paul Schaub 2024-09-17 22:40:36 +02:00
parent ad137d6351
commit 1dcf13244d
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 34 additions and 0 deletions

View file

@ -337,4 +337,34 @@ abstract class SOPGPException : RuntimeException {
const val EXIT_CODE = 101
}
}
/**
* The primary key of a KEYS object is too weak or revoked.
*/
class PrimaryKeyBad : SOPGPException {
constructor() : super()
constructor(errorMsg: String) : super(errorMsg)
override fun getExitCode(): Int = EXIT_CODE
companion object {
const val EXIT_CODE = 103
}
}
/**
* The CERTS object has no matching User ID.
*/
class CertUserIdNoMatch : SOPGPException {
constructor() : super()
constructor(errorMsg: String) : super(errorMsg)
override fun getExitCode(): Int = EXIT_CODE
companion object {
const val EXIT_CODE = 107
}
}
}