Skip to content

Commit

Permalink
Merge pull request #787 from golemfactory/bugfix/JST-693/repeatable-e…
Browse files Browse the repository at this point in the history
…rror-message

fix(errors): fixed bug with repeated message in GolemPlatformError
  • Loading branch information
mgordel authored Feb 1, 2024
2 parents dd6f412 + 0d66a99 commit f053a0c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/utils/yagna/yagna.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ export class Yagna {
}

protected addErrorHandler(api: YagnaApi) {
// Ugly solution until Yagna binding is refactored or replaced,
// and it will be possible to pass interceptors as the config params
api.net["axios"].interceptors.response.use(undefined, this.errorHandler.bind(this));
api.market["axios"].interceptors.response.use(undefined, this.errorHandler.bind(this));
api.activity.control["axios"].interceptors.response.use(undefined, this.errorHandler.bind(this));
api.activity.state["axios"].interceptors.response.use(undefined, this.errorHandler.bind(this));
api.payment["axios"].interceptors.response.use(undefined, this.errorHandler.bind(this));
/**
* Ugly solution until Yagna binding is refactored or replaced,
* and it will be possible to pass interceptors as the config params.
*
* All RequestorAPI instances (market, identity, payment, etc.) use the same Axios instance,
* so it is enough to add one interceptor to one of them to make it effective in each API.
*/
api.identity["axios"].interceptors.response.use(undefined, this.errorHandler.bind(this));
}
}

0 comments on commit f053a0c

Please sign in to comment.