Skip to content

Commit c7c1a80

Browse files
authored
remove healthcheck ping (#584)
* remove healthcheck ping * added changeset
1 parent e234a0f commit c7c1a80

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Diff for: .changeset/full-trams-learn.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@browserbasehq/stagehand": patch
3+
---
4+
5+
Fix to remove unnecessary healtcheck ping on sdk

Diff for: lib/api.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ export class StagehandAPI {
6060
},
6161
});
6262

63-
if (sessionResponse.status !== 200) {
63+
if (sessionResponse.status === 401) {
64+
throw new Error(
65+
"Unauthorized. Ensure you provided a valid API key and that it is whitelisted.",
66+
);
67+
} else if (sessionResponse.status !== 200) {
6468
console.log(await sessionResponse.text());
6569
throw new Error(`Unknown error: ${sessionResponse.status}`);
6670
}

0 commit comments

Comments
 (0)