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

Throw error if cloud apl GET fails #296

Merged
merged 2 commits into from
Nov 21, 2023
Merged

Conversation

lkostrowski
Copy link
Member

@lkostrowski lkostrowski commented Oct 6, 2023

Test with existing app first

@lkostrowski lkostrowski requested a review from a team as a code owner October 6, 2023 11:32
@changeset-bot
Copy link

changeset-bot bot commented Oct 6, 2023

🦋 Changeset detected

Latest commit: 68221eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@saleor/app-sdk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@lkostrowski lkostrowski linked an issue Oct 6, 2023 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 2023

Released snapshot build with @dev tag in npm with version: 0.0.0-pr-20231006113325

Install it with

pnpm add @saleor/[email protected]

@lkostrowski
Copy link
Member Author

@saleor/delivery-engineering-js bump - maybe @peelar or @krzysztofwolski you can try to install this from PR to one of ongoing apps to just check if it doesn't break anything, before we merge?

return undefined;
}

const parsedResponse = (await response.json().catch((e) => {
debug("Failed to parse response: %s", extractErrorMessage(e));
debug("%O", e);

throw new SaleorCloudAplError(
"RESPONSE_BODY_INVALID",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe these error codes should be an enum that we export from the library, so that it's easier for an app to handle these errors?

@lkostrowski lkostrowski force-pushed the saleor-cloud-apl-error-handling branch from a3b8593 to c9e35ca Compare November 21, 2023 11:17
@lkostrowski lkostrowski requested a review from a team November 21, 2023 11:17
Copy link
Contributor

Released snapshot build with @dev tag in npm with version: 0.0.0-pr-20231121111748

Install it with

pnpm add @saleor/[email protected]

Copy link
Contributor

Released snapshot build with @dev tag in npm with version: 0.0.0-pr-20231121112147

Install it with

pnpm add @saleor/[email protected]

Copy link
Contributor

Package Line Rate Branch Rate Complexity Health
src 83% 95% 0
src.APL 85% 85% 0
src.APL.saleor-cloud 73% 80% 0
src.app-bridge 88% 86% 0
src.handlers.next 90% 84% 0
src.handlers.next.saleor-webhooks 93% 82% 0
src.middleware 60% 97% 0
src.settings-manager 96% 89% 0
src.test-utils 100% 90% 0
src.util 76% 100% 0
Summary 85% (3310 / 3902) 87% (404 / 463) 0

@lkostrowski lkostrowski merged commit d1c30dc into main Nov 21, 2023
5 checks passed
@lkostrowski lkostrowski deleted the saleor-cloud-apl-error-handling branch November 21, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloud APL is catching failed network requests
2 participants