Uploaded image for project: 'SonarLint For IntelliJ'
  1. SonarLint For IntelliJ
  2. SLI-478

Don't throw an error when the server is offline

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.14
    • Component/s: Connected Mode
    • Labels:
      None

      Description

      When the server is offline (or when the user is offline), we should ensure that no errors are displayed.
      One issue today is with the server notification support check:

      java.lang.IllegalStateException: Fail to request http://172.23.0.37:9000/api/developers/search_events?projects=&from=
      	at org.sonarsource.sonarlint.core.util.ws.HttpConnector.doCall(HttpConnector.java:196)
      	at org.sonarsource.sonarlint.core.util.ws.HttpConnector.get(HttpConnector.java:122)
      	at org.sonarsource.sonarlint.core.util.ws.HttpConnector.call(HttpConnector.java:109)
      	at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.rawGet(SonarLintWsClient.java:120)
      	at org.sonarsource.sonarlint.core.notifications.NotificationChecker.isSupported(NotificationChecker.java:76)
      	at org.sonarsource.sonarlint.core.notifications.ServerNotifications.isSupported(ServerNotifications.java:81)
      	at org.sonarlint.intellij.core.ProjectServerNotifications.register(ProjectServerNotifications.java:105)
      	at org.sonarlint.intellij.core.ProjectServerNotifications.init(ProjectServerNotifications.java:74)
      	at org.sonarlint.intellij.BootstrapStartupActivity.runActivity(BootstrapStartupActivity.java:38)
      	at com.intellij.ide.startup.impl.StartupManagerImpl.runActivity(StartupManagerImpl.java:301)
      	at com.intellij.ide.startup.impl.StartupManagerImpl.lambda$runPostStartupActivities$3(StartupManagerImpl.java:237)
      	at com.intellij.openapi.project.DumbServiceImpl.doRun(DumbServiceImpl.java:399)
      	at com.intellij.openapi.project.DumbServiceImpl.updateFinished(DumbServiceImpl.java:391)
      	at com.intellij.openapi.project.TrackedEdtActivityService$TrackedEdtActivity.run(TrackedEdtActivityService.java:100)
      	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:216)
      	at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:24)
      	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:199)
      	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
      	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:324)
      	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:85)
      	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:134)
      	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
      	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:190)
      	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
      	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
      	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
      	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
      	at java.base/java.security.AccessController.doPrivileged(Native Method)
      	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
      	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
      	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
      	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)
      	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
      

      We should not throw an error and consider notifications as disabled. In a perfect world, we should be able to retry later to recover, but if this is too difficult, just rely on user restarting its IDE when he is back online.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                damien.urruty Damien Urruty
                Reporter:
                julien.henry Julien Henry
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: