Skip to content

Commit 0093352

Browse files
Handle 404 from @databricks/sdk-experimental (#1855)
## Changes <!-- Summary of your changes that are easy to understand --> Since #1805 the ApiError does not contain `"RESOURCE_DOES_NOT_EXIST"` but has 404 error code. This breaks existing fallback logic in uploading assets & triggering the remote workflows. This fix solves this by allowing dual responses (since sdk is still experimental, this seems more reliable than committing to either of them). ## Tests <!-- How is this tested? --> <img width="1840" height="1196" alt="Screenshot 2026-03-13 at 10 54 52" src="https://github.com/user-attachments/assets/5c8043a5-722d-45f3-9fcb-d1d51cf04b38" /> .mov recording: https://github.com/user-attachments/assets/2a49013a-c09c-4284-a55f-aed8a455f376 ## Related Fixes #1853
1 parent a8e0f7d commit 0093352

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

packages/databricks-vscode/src/run/WorkflowRunner.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,18 @@ export class WorkflowRunner implements Disposable {
221221
try {
222222
if (e instanceof ApiError) {
223223
logger.error("API error while running workflow:", e.message);
224+
const response =
225+
typeof e.response === "string"
226+
? JSON.parse(e.response)
227+
: e.response;
224228
panel.showError({
225229
message: e.message,
226230
stack:
227-
"error_trace" in e.response
228-
? new Convert().toHtml(e.response.error_trace)
231+
"error_trace" in response
232+
? new Convert().toHtml(response.error_trace)
229233
: undefined,
230234
});
231-
panel.showStdoutResult(e.response.logs || "");
235+
panel.showStdoutResult(response.logs || "");
232236
} else {
233237
logger.error("Unexpected error while running workflow:", e);
234238
panel.showError({

packages/databricks-vscode/src/sdk-extensions/wsfs/WorkspaceFsEntity.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ export abstract class WorkspaceFsEntity {
122122
return this;
123123
} catch (e: unknown) {
124124
if (e instanceof ApiError) {
125-
if (e.errorCode === "RESOURCE_DOES_NOT_EXIST") {
125+
if (
126+
e.errorCode === "RESOURCE_DOES_NOT_EXIST" ||
127+
e.statusCode === 404
128+
) {
126129
return undefined;
127130
}
128131
}
@@ -154,7 +157,8 @@ export abstract class WorkspaceFsEntity {
154157
} catch (e) {
155158
if (
156159
e instanceof ApiError &&
157-
e.errorCode === "RESOURCE_DOES_NOT_EXIST"
160+
(e.errorCode === "RESOURCE_DOES_NOT_EXIST" ||
161+
e.statusCode === 404)
158162
) {
159163
return undefined;
160164
}

0 commit comments

Comments
 (0)