Skip to content

Commit

Permalink
fix: Remove unnecessary handling for not found error code (fixes #20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Dec 11, 2024
1 parent fedc23e commit 0383b52
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/core/utils/http.utils.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { HttpService, IRetryStrategyOptions } from '@kontent-ai/core-sdk';
import { OriginalManagementError } from '../models/core.models.js';
import { match } from 'ts-pattern';
import { OriginalManagementError } from '../models/core.models.js';

const rateExceededErrorCode: number = 10000;
const notFoundErrorCode: number = 10000;

export const defaultHttpService: Readonly<HttpService> = new HttpService({
logErrorsToConsole: false
Expand All @@ -19,8 +18,6 @@ export const defaultRetryStrategy: Readonly<IRetryStrategyOptions> = {
match(errorCode)
// retry rate exceeded error
.with(rateExceededErrorCode, () => true)
// do not retry errors indicating resource does not exist
.with(notFoundErrorCode, () => false)
// if error code is set, do not retry the request
.when(
(errorCode) => errorCode >= 0,
Expand Down

0 comments on commit 0383b52

Please sign in to comment.