Combined constructors.
This commit is contained in:
parent
952be64864
commit
09ed1dcda4
1 changed files with 5 additions and 20 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue