Combined constructors.

This commit is contained in:
Erik C. Thauvin 2021-11-17 08:39:01 -08:00
parent 952be64864
commit 09ed1dcda4

View file

@ -35,26 +35,11 @@ package net.thauvin.erik.crypto
/** /**
* Thrown when an exceptional condition has occurred. * Thrown when an exceptional condition has occurred.
*/ */
@Suppress("unused") class CryptoException @JvmOverloads constructor(
class CryptoException : Exception { var statusCode: Int = NO_STATUS,
var statusCode: Int message: String,
private set cause: Throwable? = null
) : Exception(message, cause) {
/** Constructs a new exception with the specified status code, message and cause. */
constructor(statusCode: Int = NO_STATUS, message: String, cause: Throwable) : super(message, cause) {
this.statusCode = statusCode
}
/** Constructs a new exception with the specified status code and message. */
constructor(statusCode: Int = NO_STATUS, message: String) : super(message) {
this.statusCode = statusCode
}
/** Constructs a new exception with the specified status code and cause. */
constructor(statusCode: Int = NO_STATUS, cause: Throwable) : super(cause) {
this.statusCode = statusCode
}
companion object { companion object {
const val NO_STATUS = -1 const val NO_STATUS = -1
private const val serialVersionUID = 1L private const val serialVersionUID = 1L