Skip to content

Commit

Permalink
fix(riskAPI): handleFailover shouldn't expect user.id
Browse files Browse the repository at this point in the history
  • Loading branch information
johnytiago committed Dec 15, 2022
1 parent 9c3a3c4 commit ec92d16
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/api/services/api-filter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { APIService } from './api.service';
import AbortController from 'abort-controller';

const handleFailover = (
userId: string,
reason: string,
configuration: Configuration,
err?: Error
Expand All @@ -18,7 +17,6 @@ const handleFailover = (
if (configuration.failoverStrategy === FailoverStrategy.throw) {
throw err;
}

return {
policy: {
action: configuration.failoverStrategy,
Expand Down Expand Up @@ -52,9 +50,9 @@ export const APIFilterService = {
);
} catch (e) {
if (isTimeoutError(e)) {
return handleFailover(options.user.id, 'timeout', configuration, e);
return handleFailover('timeout', configuration, e);
} else if (e instanceof InternalServerError) {
return handleFailover(options.user.id, 'server error', configuration);
return handleFailover('server error', configuration, e);
} else {
throw e;
}
Expand Down

0 comments on commit ec92d16

Please sign in to comment.