Skip to content

Commit e0ecf03

Browse files
committed
add a few code to diagnosis the error
1 parent 8b97a9f commit e0ecf03

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ plugins {
2727
}
2828

2929
group = "io.github.udhayarajan"
30-
version = "5.3.7"
30+
version = "5.3.8"
3131
//Version Naming incremented if "<NEW_FEATURE_ADDED>.<WORKED_ON_BUG>.<BETA_VERSION_COUNT>"
3232
//Priority on incrementing Feature > BugFix > Beta
3333

src/commonMain/kotlin/com/mugames/vidsnapkit/network/HttpRequestHelper.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class HttpInterfaceImpl(
8080
setBody(TextContent(it.toJsonString(), ContentType.Application.Json))
8181
}
8282
}.bodyAsText()
83-
} catch (e: Error) {
83+
} catch (e: Exception) {
8484
logger.error(
8585
"postData() url=${url} header=${headers.toString()} & postData=${postData.toString()} Error:",
8686
e
@@ -128,6 +128,9 @@ class HttpInterfaceImpl(
128128
} catch (e: ClientRequestException) {
129129
logger.error("checkWebPage() url=${url} header=${headers.toString()} ClientRequestException:", e)
130130
false
131+
} catch (e: Exception) {
132+
logger.error("checkWebPage() url=${url} header=${headers.toString()} GenericException:", e)
133+
false
131134
}
132135
}
133136

@@ -160,7 +163,7 @@ class HttpInterfaceImpl(
160163
} catch (e: SendCountExceedException) {
161164
if (url.contains("instagram") && headers?.containsKey("Cookie") == true)
162165
"{error:\"Invalid Cookies\"}"
163-
else{
166+
else {
164167
logger.error("getData() url=${url} header=${headers.toString()} SendCountExceedException:", e)
165168
throw e
166169
}
@@ -208,6 +211,7 @@ class HttpInterfaceImpl(
208211
.matcher(locationUrl)
209212
if (!matcher.find())
210213
locationUrl = cacheResponse.request.url.protocolWithAuthority + locationUrl
214+
logger.info("redirection ${cacheResponse.request.url}->${locationUrl} [${cacheResponse.status.value}]")
211215
val nonRedirectingClient = client.config {
212216
followRedirects = false
213217
}

0 commit comments

Comments
 (0)