diff --git a/app/src/main/kotlin/com/fibelatti/pinboard/core/di/modules/LinkdingModule.kt b/app/src/main/kotlin/com/fibelatti/pinboard/core/di/modules/LinkdingModule.kt
index 36b199b9..b44fb250 100644
--- a/app/src/main/kotlin/com/fibelatti/pinboard/core/di/modules/LinkdingModule.kt
+++ b/app/src/main/kotlin/com/fibelatti/pinboard/core/di/modules/LinkdingModule.kt
@@ -44,6 +44,8 @@ object LinkdingModule {
accept(ContentType.Application.Json)
}
+ expectSuccess = true
+
install(unauthorizedPluginProvider.plugin)
}
}
diff --git a/app/src/main/kotlin/com/fibelatti/pinboard/features/posts/presentation/EditPostViewModel.kt b/app/src/main/kotlin/com/fibelatti/pinboard/features/posts/presentation/EditPostViewModel.kt
index 554cfd9c..f8ae9fc8 100644
--- a/app/src/main/kotlin/com/fibelatti/pinboard/features/posts/presentation/EditPostViewModel.kt
+++ b/app/src/main/kotlin/com/fibelatti/pinboard/features/posts/presentation/EditPostViewModel.kt
@@ -15,6 +15,8 @@ import com.fibelatti.pinboard.features.posts.domain.usecase.AddPost
import com.fibelatti.pinboard.features.posts.domain.usecase.InvalidUrlException
import com.fibelatti.pinboard.features.tags.domain.model.Tag
import dagger.hilt.android.lifecycle.HiltViewModel
+import io.ktor.client.plugins.ClientRequestException
+import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
@@ -34,7 +36,6 @@ import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.flow.withIndex
import kotlinx.coroutines.launch
-import javax.inject.Inject
@HiltViewModel
class EditPostViewModel @Inject constructor(
@@ -111,7 +112,7 @@ class EditPostViewModel @Inject constructor(
currentState.copy(isLoading = false)
}
when (error) {
- is InvalidUrlException -> {
+ is InvalidUrlException, is ClientRequestException -> {
_screenState.update { currentState ->
currentState.copy(
invalidUrlError = resourceProvider.getString(R.string.validation_error_invalid_url),
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3cf0c846..97b28e66 100755
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -130,7 +130,7 @@
The URL cannot be empty
- The URL is invalid
+ The URL is not accepted by the service
The URL could not be saved. Please verify that it is valid
The title cannot be empty