]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-14648 Handle 'Open in IDE' errors
authorJeremy Davis <jeremy.davis@sonarsource.com>
Wed, 25 May 2022 12:46:39 +0000 (14:46 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 25 May 2022 20:03:17 +0000 (20:03 +0000)
server/sonar-web/src/main/js/helpers/sonarlint.ts

index 3ed89ca75e073849985f7bbd209180da98e8ae5e..3e48575a5cb2b11a2131e274b833e9780b0a9816 100644 (file)
@@ -19,6 +19,7 @@
  */
 import { getHostUrl } from '../helpers/urls';
 import { Ide } from '../types/sonarlint';
+import { checkStatus } from './request';
 
 const SONARLINT_PORT_START = 64120;
 const SONARLINT_PORT_RANGE = 11;
@@ -43,7 +44,7 @@ export function openHotspot(calledPort: number, projectKey: string, hotspotKey:
   showUrl.searchParams.set('server', getHostUrl());
   showUrl.searchParams.set('project', projectKey);
   showUrl.searchParams.set('hotspot', hotspotKey);
-  return fetch(showUrl.toString());
+  return fetch(showUrl.toString()).then((response: Response) => checkStatus(response, true));
 }
 
 /**