IJPL-172106 Warn macOS 15 users about potential issues with OS firewall, suggest workarounds

(cherry picked from commit f93923104bbac9611ff2c1441af07ca753cbb0dd)

IJ-CR-150531

GitOrigin-RevId: 10a02c7b325a0e9a859e3a8b4e25069ec7827562
This commit is contained in:
Alexander Lobas
2024-12-01 15:36:43 +01:00
committed by intellij-monorepo-bot
parent 8fe2820ca8
commit 4e0243a930

View File

@@ -19,15 +19,17 @@ import java.net.NoRouteToHostException
object NetUtils {
private const val URL = "https://youtrack.jetbrains.com/articles/SUPPORT-A-564/Cannot-connect-to-remote-host-No-route-to-host-macOS-15-Sequoia"
private fun isNoRouteException(error: Throwable) = error is NoRouteToHostException || error.cause is NoRouteToHostException
fun getNetworkErrorSolutionMessage(error: Throwable, full: Boolean): @Nls String? {
if (SystemInfo.isMacOSSequoia && error is NoRouteToHostException) {
if (SystemInfo.isMacOSSequoia && isNoRouteException(error)) {
return IdeCoreBundle.message(if (full) "mac15.local.network.issue.full.message" else "mac15.local.network.issue.message")
}
return null
}
fun showNetworkErrorSolutionNotification(error: Throwable, project: Project?) {
if (Registry.`is`("mac15.local.network.issue", true) && SystemInfo.isMacOSSequoia && error is NoRouteToHostException) {
if (Registry.`is`("mac15.local.network.issue", true) && SystemInfo.isMacOSSequoia && isNoRouteException(error)) {
Notification("Mac15 Local Network",
IdeCoreBundle.message("mac15.local.network.issue.title"),
IdeCoreBundle.message("mac15.local.network.issue.notification.message"),