DBE-21397: Enable data source templates

Merge-request: IJ-CR-196311
Merged-by: Ilia Epelbaum <ilia.epelbaum@jetbrains.com>
(cherry picked from commit 87cbf1673dc286f885cbdad908b9f69867ca7cfb)

GitOrigin-RevId: bedecc777f2c92c10ab950ab367f4db96cd0ffca
This commit is contained in:
Ilia Epelbaum
2026-03-16 21:49:36 +00:00
committed by intellij-monorepo-bot
parent 0c48fcf788
commit cc229583d2
3 changed files with 2 additions and 19 deletions
@@ -204,6 +204,3 @@ sync.remove.data.error.message.title=Failed to delete account sync data
sync.remove.data.error.message.action.delete=Delete sync data
sync.remove.data.error.message.action.support=Contact support
sync.remove.data.progress.message=Deleting data\u2026
unknown.host.error.message=Unknown host (Please check your Internet connection)
unknown.host.error.message.with.additional.message=Unknown host {0} (Please check your Internet connection)
@@ -8,7 +8,6 @@ import com.intellij.util.io.delete
import org.jetbrains.annotations.VisibleForTesting
import java.io.IOException
import java.io.InputStream
import java.net.UnknownHostException
import java.util.UUID
import kotlin.io.path.inputStream
@@ -149,23 +148,10 @@ abstract class AbstractServerCommunicator : SettingsSyncRemoteCommunicator, Disp
return SettingsSyncPushResult.Rejected
}
catch (e: Throwable) {
return SettingsSyncPushResult.Error(customizeErrorMessage(e) ?: defaultMessage)
return SettingsSyncPushResult.Error(e.message ?: defaultMessage)
}
}
protected fun customizeErrorMessage(e: Throwable): String? {
if (e is UnknownHostException) {
val message = e.message
if (message != null) {
return SettingsSyncBundle.message("unknown.host.error.message.with.additional.message", message)
}
return SettingsSyncBundle.message("unknown.host.error.message")
}
return e.message
}
override fun checkServerState(): ServerState {
try {
val snapshotFilePath = currentSnapshotFilePath()?.first ?: return ServerState.Error("Unknown error during checkServerState")
@@ -104,7 +104,7 @@ open class CloudConfigServerCommunicator(private val serverUrl: String?, private
else {
LOG.error(e)
}
return customizeErrorMessage(e) ?: defaultMessage
return e.message ?: defaultMessage
}
fun downloadSnapshot(filePath: String, version: FileVersionInfo): InputStream? {