@browserstack/mcp-server 1.2.35 → 1.2.36-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/tm-base-url.js +7 -1
- package/package.json +1 -1
package/dist/lib/tm-base-url.js
CHANGED
|
@@ -20,6 +20,7 @@ export async function getTMBaseURL(config) {
|
|
|
20
20
|
const authString = getBrowserStackAuth(config);
|
|
21
21
|
const [username, password] = authString.split(":");
|
|
22
22
|
const authHeader = "Basic " + Buffer.from(`${username}:${password}`).toString("base64");
|
|
23
|
+
const failures = [];
|
|
23
24
|
for (const baseUrl of TM_BASE_URLS) {
|
|
24
25
|
try {
|
|
25
26
|
const res = await apiClient.get({
|
|
@@ -27,6 +28,9 @@ export async function getTMBaseURL(config) {
|
|
|
27
28
|
headers: { Authorization: authHeader },
|
|
28
29
|
raise_error: false,
|
|
29
30
|
});
|
|
31
|
+
if (!res.ok) {
|
|
32
|
+
failures.push(`${baseUrl}: HTTP ${res.status}`);
|
|
33
|
+
}
|
|
30
34
|
if (res.ok) {
|
|
31
35
|
// Only populate the cache in single-tenant (stdio) mode; in remote mode
|
|
32
36
|
// the cache must stay empty so each user discovers their own region.
|
|
@@ -38,8 +42,10 @@ export async function getTMBaseURL(config) {
|
|
|
38
42
|
}
|
|
39
43
|
}
|
|
40
44
|
catch (err) {
|
|
45
|
+
const code = err?.code ?? err?.message;
|
|
46
|
+
failures.push(`${baseUrl}: ${code}`);
|
|
41
47
|
logger.debug(`Failed TM base URL: ${baseUrl} (${err})`);
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
|
-
throw new Error(
|
|
50
|
+
throw new Error(`Unable to connect to BrowserStack Test Management. Please check your credentials and network connection.Please open an issue on GitHub if the problem persists. Details: ${failures.join("; ")}`);
|
|
45
51
|
}
|