Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle rejection of provider in provider engine #454

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Changelog

_Note: Gaps between patch versions are faulty, broken or test releases._

## v3.101.3 (2024-12-16)

#### :bug: Bug Fix

* Added handling the rejection of provider in provider request engine `core/request/engines/provider`

## v3.101.2 (2024-12-09)

#### :bug: Bug Fix
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "lib/core/index.js",
"typings": "index.d.ts",
"license": "MIT",
"version": "3.101.2",
"version": "3.101.3",
"author": "kobezzza <[email protected]> (https://github.com/kobezzza)",
"repository": {
"type": "git",
Expand Down
6 changes: 6 additions & 0 deletions src/core/request/engines/provider/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Changelog
> - :house: [Internal]
> - :nail_care: [Polish]

## v3.101.3 (2024-12-16)

#### :bug: Bug Fix

* Added handling the rejection of provider in provider request engine

## v3.78.0 (2022-03-16)

#### :rocket: New Feature
Expand Down
15 changes: 12 additions & 3 deletions src/core/request/engines/provider/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,20 @@ export default function createProviderEngine(

params.emitter.emit('drainListeners');

let providerResObj;

try {
providerResObj = await req;

} catch (err) {
reject(err);
return;
}

const
providerResObj = await req,
providerResponse = providerResObj.response;
providerResponse = providerResObj.response,
getResponse = () => providerResObj.data;

const getResponse = () => providerResObj.data;
getResponse[Symbol.asyncIterator] = () => {
const
type = providerResponse.sourceResponseType;
Expand Down
Loading