Skip to content

Commit 9baef9f

Browse files
committed
📚 Improve error message (#1995)
1 parent c065892 commit 9baef9f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/clients/http_client.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ export class HttpRequestClient {
5252

5353
return data;
5454
} catch (error) {
55-
throw new Error(`Failed to fetch from ${endpoint}: ${error}`);
55+
throw new Error(
56+
`Failed to fetch from ${endpoint}: ${error instanceof Error ? error.message : String(error)}`,
57+
{ cause: error as Error },
58+
);
5659
}
5760
}
5861
}

0 commit comments

Comments
 (0)