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(server$): return content type changes #6345

Merged
merged 3 commits into from
May 21, 2024

Conversation

PatrickJS
Copy link
Member

@PatrickJS PatrickJS commented May 20, 2024

when server$ lambda blows up the content type changes.

this is needed for debugging

Copy link

netlify bot commented May 20, 2024

Deploy Preview for qwik-insights ready!

Name Link
🔨 Latest commit 81332cd
🔍 Latest deploy log https://app.netlify.com/sites/qwik-insights/deploys/664bd1371f6a90000898d235
😎 Deploy Preview https://deploy-preview-6345--qwik-insights.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

cloudflare-pages bot commented May 20, 2024

Deploying qwik-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 81332cd
Status: ✅  Deploy successful!
Preview URL: https://8a857b08.qwik-8nx.pages.dev
Branch Preview URL: https://fix-server--json-response-la.qwik-8nx.pages.dev

View logs

@@ -380,6 +380,18 @@ export const serverQrl = <T extends ServerFunction>(
throw obj;
}
return obj;
} else if (contentType === 'application/json') {
Copy link
Member Author

@PatrickJS PatrickJS May 21, 2024

Choose a reason for hiding this comment

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

theses cases should never be hit but in cases that I mentioned it's better that they're handled

Copy link
Member

@thejackshelton thejackshelton left a comment

Choose a reason for hiding this comment

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

Looks good to me! More descriptive errors -> happiness :)

@PatrickJS PatrickJS merged commit f38f153 into main May 21, 2024
29 checks passed
@PatrickJS PatrickJS deleted the fix-server$-json-response-lambda-error branch May 21, 2024 01:39
@gioboa
Copy link
Member

gioboa commented May 21, 2024

You are doing a great job @PatrickJS 🚀

@@ -380,6 +380,18 @@ export const serverQrl = <T extends ServerFunction>(
throw obj;
}
return obj;
} else if (contentType === 'application/json') {
const obj = await res.json();
if (res.status === 500) {
Copy link
Member

Choose a reason for hiding this comment

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

Should be >=400, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

it should never hit this case but for example of the Lambda blows up then aws will change the return headers/value

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.

None yet

4 participants