Repository navigation
Conversation
|
Thanks for contributing to Supabase! ❤️ Our team will review your PR. A few tips for a smoother review process:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
|
@Nyx-abu is attempting to deploy a commit to the Supabase Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe edge-function test API now extracts error messages from multiple JSON response shapes while preserving the existing status and response structure. JSDoc comments describe the route handler and POST processing flow. ChangesEdge Function Error Handling
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
I have read the CONTRIBUTING.md file.
YES
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
When testing Edge Functions via the Studio API, if the function returns a non-OK status with a JSON response, the API often fails to extract the actual error message. It falls back to a generic "Failed to run edge function" because it assumes a very strict shape of JSON.parse(data).error.
Resolves #47835
What is the new behavior?
The API now checks multiple common error property locations in the JSON response (error.message, error, message, msg) to extract the actual error string. If none are found, it falls back to stringifying the entire JSON object so developers still get the raw context, rather than completely dropping it.
Additional context
Added a docstring to the extractErrorMessage function to improve code coverage and maintainability.
Summary by CodeRabbit