mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-07 17:29:44 +02:00
Add new Exception types
This commit is contained in:
parent
a72545e3b9
commit
65aa0afd4e
1 changed files with 35 additions and 0 deletions
|
@ -16,6 +16,22 @@ abstract class SOPGPException : RuntimeException {
|
|||
|
||||
abstract fun getExitCode(): Int
|
||||
|
||||
/** An otherwise unspecified failure occurred */
|
||||
class UnspecificFailure : SOPGPException {
|
||||
|
||||
constructor(message: String) : super(message)
|
||||
|
||||
constructor(message: String, e: Throwable) : super(message, e)
|
||||
|
||||
constructor(e: Throwable) : super(e)
|
||||
|
||||
override fun getExitCode(): Int = EXIT_CODE
|
||||
|
||||
companion object {
|
||||
const val EXIT_CODE = 1
|
||||
}
|
||||
}
|
||||
|
||||
/** No acceptable signatures found (sop verify, inline-verify). */
|
||||
class NoSignature : SOPGPException {
|
||||
@JvmOverloads
|
||||
|
@ -378,4 +394,23 @@ abstract class SOPGPException : RuntimeException {
|
|||
const val EXIT_CODE = 107
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Key not certification-capable (e.g., expired, revoked, unacceptable usage flags) (sop
|
||||
* certify-userid)
|
||||
*/
|
||||
class KeyCannotCertify : SOPGPException {
|
||||
|
||||
constructor(message: String) : super(message)
|
||||
|
||||
constructor(message: String, e: Throwable) : super(message, e)
|
||||
|
||||
constructor(e: Throwable) : super(e)
|
||||
|
||||
override fun getExitCode(): Int = EXIT_CODE
|
||||
|
||||
companion object {
|
||||
const val EXIT_CODE = 109
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue