Back

Error details getting a function execution

  • 0
  • Self Hosted
  • Functions
Guille
4 Mar, 2024, 17:16

It's expected to not get any details when I request the state of a function execution?

I have create a function that throws an error:

TypeScript
export default async ({ req, res, log, error }) => {
  throw new Error("HELLO_WORLD");
};

the I execute it asynchronously, and I get the status with getExecution.

However I don't see any error details:

TypeScript
{
    "trigger": "http",
    "status": "failed",
    "requestMethod": "POST",
    "requestPath": "/",
    "requestHeaders": [],
    "responseStatusCode": 500,
    "responseBody": "",
    "logs": "",
    "errors": "",
    "duration": 0.0054829120635986
}

Is there any way to get that information? (HELLO_WORD)

res.send("HELLO_WORLD") doesn't get any information as well

Why I need this?

As function have more chance to get timeout when the execution is synchronous, I'm trying to get a similar behavior with async, but error handling isn't easy without getting something more specific than error 500 or failed

TL;DR
Developers are encountering issues with error details not being displayed when requesting the state of a function execution. They are expecting to see more specific error information like "HELLO_WORLD" but are only receiving generic error statuses like "failed" or "500". This makes error handling difficult. The desired information is not being captured in the logs or response body.
Steven
4 Mar, 2024, 17:34

it's supposed to...i think this is a bug

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more