Skip to content

Commit

Permalink
Merge e290dc0 into 9618dd1
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored Sep 23, 2023
2 parents 9618dd1 + e290dc0 commit f59d487
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/api/src/utils/client/httpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export class ApiError extends Error {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
static assert(res: ApiClientResponse, message?: string): asserts res is ApiClientSuccessResponse<any, unknown> {
if (!res.ok) {
throw new ApiError([message, res.error.message].join(" - "), res.error.code, res.error.operationId);
throw new ApiError(
[message, res.error.message].filter(Boolean).join(" - "),
res.error.code,
res.error.operationId
);
}
}

Expand Down

0 comments on commit f59d487

Please sign in to comment.