Skip to content

Commit e09e3db

Browse files
committed
rename to statusCode for consistency
1 parent 2c85029 commit e09e3db

File tree

2 files changed

+12
-8
lines changed
  • kotlin-atlassian-client-core-common/src/main/kotlin/com/linkedplanet/kotlinatlassianclientcore/common/error
  • kotlin-insight-client/kotlin-insight-client-api/src/main/kotlin/com/linkedplanet/kotlininsightclient/api/error

2 files changed

+12
-8
lines changed

kotlin-atlassian-client-core-common/src/main/kotlin/com/linkedplanet/kotlinatlassianclientcore/common/error/AtlassianClientError.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ open class AtlassianClientError(
2828
@field:NotNull val error: String,
2929
@field:NotNull val message: String,
3030
@field:NotNull val stacktrace: String = "",
31-
val httpStatusCode: Int? = null
31+
val statusCode: Int? = null
3232
) {
3333

3434
override fun equals(other: Any?): Boolean {
@@ -38,7 +38,7 @@ open class AtlassianClientError(
3838
if (error != other.error) return false
3939
if (message != other.message) return false
4040
if (stacktrace != other.stacktrace) return false
41-
if (httpStatusCode != other.httpStatusCode) return false
41+
if (statusCode != other.statusCode) return false
4242

4343
return true
4444
}
@@ -47,12 +47,12 @@ open class AtlassianClientError(
4747
var result = error.hashCode()
4848
result = 31 * result + message.hashCode()
4949
result = 31 * result + stacktrace.hashCode()
50-
result = 31 * result + (httpStatusCode ?: 0)
50+
result = 31 * result + (statusCode ?: 0)
5151
return result
5252
}
5353

5454
override fun toString(): String {
55-
return "AtlassianClientError(error='$error', message='$message', stacktrace='$stacktrace')"
55+
return "AtlassianClientError(error='$error', message='$message', stacktrace='$stacktrace', httpStatusCode=$statusCode)"
5656
}
5757

5858
companion object

kotlin-insight-client/kotlin-insight-client-api/src/main/kotlin/com/linkedplanet/kotlininsightclient/api/error/InsightClientError.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ import io.swagger.v3.oas.annotations.media.Schema
4747
sealed class InsightClientError(
4848
error: String,
4949
message: String,
50-
stacktrace: String = ""
51-
) : AtlassianClientError(error, message, stacktrace) {
50+
stacktrace: String = "",
51+
statusCode: Int? = null
52+
) : AtlassianClientError(error, message, stacktrace, statusCode) {
5253

5354
companion object {
5455
private const val internalErrorString = "Jira/Insight hat ein internes Problem festgestellt"
@@ -81,6 +82,9 @@ open class OtherInsightClientError(error: String, message: String) : InsightClie
8182
/**
8283
* Somewhere inside an HTTP connection failed.
8384
*/
84-
class HttpInsightClientError(val statusCode: Int, error: String, message: String) : InsightClientError(error,
85-
"$message StatusCode:$statusCode"
85+
class HttpInsightClientError(statusCode: Int, error: String, message: String) :
86+
InsightClientError(
87+
error = error,
88+
message = "$message StatusCode:$statusCode",
89+
statusCode = statusCode
8690
)

0 commit comments

Comments
 (0)