Skip to content

Commit 7fc48a3

Browse files
pieternfjakobs
andauthored
Generate code for the cluster API (#24)
* Generate code for the cluster API Co-authored-by: Fabian Jakobs <fabian.jakobs@databricks.com>
1 parent 185eeb1 commit 7fc48a3

File tree

9 files changed

+854
-156
lines changed

9 files changed

+854
-156
lines changed

packages/databricks-sdk-js/src/api-client.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ export class ApiClient {
5858
}
5959
}
6060

61+
// throw error if the URL is incorrect and we get back an HTML page
62+
if (response.headers.get("content-type")?.match("text/html")) {
63+
throw new HttpError(`Can't connect to ${url.toString()}`, 404);
64+
}
65+
6166
let responseBody = await response.arrayBuffer();
6267
let responseText = new TextDecoder().decode(responseBody);
6368

0 commit comments

Comments
 (0)