I’m using the Supabase plugin to invoke my edge functions, and I’m struggling with how the plugin identifies errors in the function response.
The Edge Function returns 400 or 500, but the plugin doesn’t trigger the OnError part of the workflow.
The response body contains a JSON object with “{“error”: “Something wrong happened”}”.
Am I missing anything when calling the function from WeWeb? Do I need to return something specific so the plugin identifies 4xx or 5xx status codes as errors?
I’m adding a few screenshots to show what I’m seeing in the Network console and the editor.
Please open a ticket on support.weweb.io, we will give a look, normally if the error is well formed it should throw, maybe it’s an issue related to the specific code you have in your edge function
Thanks @Alexis! I’ve opened a ticket like you said. I’m happy to share my Edge Function code if necessary, but it’s a simple response with 400 status as shown in the console.
I’ll wait to see if you guys need more data on this one.
In the console (dev mode) you can navigate to Network (tab) and you can inspect the Network calls, if you open up the response of your 40X requests, there usually is a hint, or a reason behind the error.
But in his case, the error is not recognized as any of the possible error types. I pushed a fix to add another case to handle unrecognized error, that should be enough, it’s in QA right now