Skip to content

Commit

Permalink
add a few code to diagnosis the error
Browse files Browse the repository at this point in the history
  • Loading branch information
Udhayarajan committed Jun 25, 2023
1 parent 8b97a9f commit e0ecf03
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ plugins {
}

group = "io.github.udhayarajan"
version = "5.3.7"
version = "5.3.8"
//Version Naming incremented if "<NEW_FEATURE_ADDED>.<WORKED_ON_BUG>.<BETA_VERSION_COUNT>"
//Priority on incrementing Feature > BugFix > Beta

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class HttpInterfaceImpl(
setBody(TextContent(it.toJsonString(), ContentType.Application.Json))
}
}.bodyAsText()
} catch (e: Error) {
} catch (e: Exception) {
logger.error(
"postData() url=${url} header=${headers.toString()} & postData=${postData.toString()} Error:",
e
Expand Down Expand Up @@ -128,6 +128,9 @@ class HttpInterfaceImpl(
} catch (e: ClientRequestException) {
logger.error("checkWebPage() url=${url} header=${headers.toString()} ClientRequestException:", e)
false
} catch (e: Exception) {
logger.error("checkWebPage() url=${url} header=${headers.toString()} GenericException:", e)
false
}
}

Expand Down Expand Up @@ -160,7 +163,7 @@ class HttpInterfaceImpl(
} catch (e: SendCountExceedException) {
if (url.contains("instagram") && headers?.containsKey("Cookie") == true)
"{error:\"Invalid Cookies\"}"
else{
else {
logger.error("getData() url=${url} header=${headers.toString()} SendCountExceedException:", e)
throw e
}
Expand Down Expand Up @@ -208,6 +211,7 @@ class HttpInterfaceImpl(
.matcher(locationUrl)
if (!matcher.find())
locationUrl = cacheResponse.request.url.protocolWithAuthority + locationUrl
logger.info("redirection ${cacheResponse.request.url}->${locationUrl} [${cacheResponse.status.value}]")
val nonRedirectingClient = client.config {
followRedirects = false
}
Expand Down

0 comments on commit e0ecf03

Please sign in to comment.