Skip to content

Commit ad99854

Browse files
committed
Expose more details about FireFly errors
Signed-off-by: Andrew Richardson <[email protected]>
1 parent bc180f1 commit ad99854

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

lib/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default class HttpBase {
6060
return response.catch((err) => {
6161
if (axios.isAxiosError(err)) {
6262
const errorMessage = err.response?.data?.error;
63-
const ffError = new FireFlyError(errorMessage ?? err.message);
63+
const ffError = new FireFlyError(errorMessage ?? err.message, err, err.request.path);
6464
if (this.errorHandler !== undefined) {
6565
this.errorHandler(ffError);
6666
}

lib/interfaces.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import { operations } from './schema';
1313

1414
// General
1515

16-
export class FireFlyError extends Error {}
16+
export class FireFlyError extends Error {
17+
constructor(message?: string, public originalError?: Error, public path?: string) {
18+
super(message);
19+
}
20+
}
1721

1822
export interface FireFlyGetOptions {
1923
confirm: undefined;

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyperledger/firefly-sdk",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"description": "Client SDK for Hyperledger FireFly",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)