Skip to content

Commit

Permalink
Merge pull request #454 from V4Fire/kormanowsky/handle-provider-engin…
Browse files Browse the repository at this point in the history
…e-reject

fix: handle rejection of provider in provider engine
  • Loading branch information
gretzkiy authored Dec 16, 2024
2 parents ae8f757 + 41a5b79 commit 1890d19
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
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

0 comments on commit 1890d19

Please sign in to comment.