Skip to content

Commit

Permalink
fix: propagate more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
x-oflisback committed Sep 22, 2022
1 parent 465ab5a commit b30acaa
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export class Client {
`${this.baseUrl}${this.jhUserPath}impact/api/workspaces`
)
.then((response) => resolve(response.data?.data?.items))
.catch((e) => reject(e))
})
.catch((e) => reject(e))
})
Expand All @@ -255,6 +256,7 @@ export class Client {
.then((response) =>
resolve(response.data.experiment_id)
)
.catch((e) => reject(e))
})
.catch((e) => reject(e))
})
Expand Down Expand Up @@ -286,6 +288,7 @@ export class Client {
.then(() => resolve())
.catch((e) => reject(e))
})
.catch((e) => reject(e))
})
}

Expand All @@ -304,6 +307,7 @@ export class Client {
`${this.baseUrl}${this.jhUserPath}/impact/api/workspaces/${workspaceId}/experiments/${experimentId}/execution`
)
.then((response) => resolve(response.data))
.catch((e) => reject(e))
})
.catch((e) => reject(e))
})
Expand All @@ -322,10 +326,14 @@ export class Client {
})
while (data.status !== 'done') {
await sleep(1000)
data = await this.getExecutionStatus({
experimentId,
workspaceId,
})
try {
data = await this.getExecutionStatus({
experimentId,
workspaceId,
})
} catch (e) {
throw e;
}
}
}

Expand Down Expand Up @@ -366,6 +374,7 @@ export class Client {
`${this.baseUrl}${this.jhUserPath}impact/api/workspaces/${workspaceId}/custom-functions`
)
.then((response) => resolve(response.data.data.items))
.catch((e) => reject(e))
})
.catch((e) => reject(e))
})
Expand All @@ -386,6 +395,7 @@ export class Client {
`${this.baseUrl}${this.jhUserPath}impact/api/workspaces/${workspaceId}/experiments/${experimentId}/cases`
)
.then((response) => resolve(response.data?.data?.items))
.catch((e) => reject(e))
})
.catch((e) => reject(e))
})
Expand All @@ -411,6 +421,7 @@ export class Client {
{ variable_names: variableNames }
)
.then((res) => resolve(res.data))
.catch((e) => reject(e))
})
.catch((e) => reject(e))
})
Expand Down

0 comments on commit b30acaa

Please sign in to comment.