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

🚀 Feature: Mark 40X Function Executions as Failed #5161

Open
2 tasks done
sanny-io opened this issue Feb 25, 2023 · 8 comments
Open
2 tasks done

🚀 Feature: Mark 40X Function Executions as Failed #5161

sanny-io opened this issue Feb 25, 2023 · 8 comments
Assignees
Labels
product / functions Fixes and upgrades for the Appwrite Functions.
Milestone

Comments

@sanny-io
Copy link

🔖 Feature description

Responding to a request currently marks the execution as completed. I suggest that there be a way to signal failure in the dashboard, while also providing a response to the user.

🎤 Pitch

This gives developers the ability to give users a specific reason regarding the error that occurred, while also not misleadingly labeling an execution as successful in the dashboard.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@stnguyen90
Copy link
Contributor

@sanny-io, thanks for creating this issue! 🙏🏼 This seems like a duplicate of #4594? Once this change is released, your function code can return a status 500 and the response should still be returned and include the details of your error.

@stnguyen90 stnguyen90 added the product / functions Fixes and upgrades for the Appwrite Functions. label Feb 27, 2023
@stnguyen90 stnguyen90 self-assigned this Feb 27, 2023
@sanny-io
Copy link
Author

Sorry, I did not see that issue, although it appears to only apply to 5xx errors. Would a pull request to include 4xx errors be ok?

@stnguyen90
Copy link
Contributor

@sanny-io response and stdout should be returned for 400 errors. What is your function returning and what do you see in Appwrite?

@sanny-io
Copy link
Author

sanny-io commented Mar 5, 2023

The response is returned for 400 errors, but what I am trying to say that it does not make sense to report the function as completed in the console.

Imagine you have users reporting that your app is not working as expected (they are receiving 400 errors), but everything in the dashboard is green.

module.exports = (request, response) => {
    response.json({
        success: false,
        message: 'Error'
    }, 400)
}

In this picture, 🟢 completed should be 🔴 failed

@stnguyen90
Copy link
Contributor

@sanny-io, ah I see. I'll bring this up to the team.

@stnguyen90
Copy link
Contributor

@sanny-io in our next version, we'll be marking 40X errors as failed....That said, doing so will make it more difficult to differentiate between whether a function execution failed due to an error or if it was a bad request.

@stnguyen90 stnguyen90 changed the title 🚀 Feature: Allow functions to respond and throw an error. 🚀 Feature: Mark 40X Function Executions as Failed Mar 8, 2023
@stnguyen90 stnguyen90 added this to the 1.3.0 milestone Mar 8, 2023
@stnguyen90 stnguyen90 assigned Meldiron and unassigned stnguyen90 Mar 8, 2023
@sanny-io
Copy link
Author

sanny-io commented Mar 8, 2023

Bad requests are considered errors, just client ones...but I see what you mean xD

I think the tradeoff is worth it. There is no easy way to find where a problem is if everything is green, and most libraries and frameworks will report an error if they encounter 4xx, including devtools.

@stnguyen90 stnguyen90 modified the milestones: 1.3.0, 1.4.0 Mar 8, 2023
@gewenyu99
Copy link

gewenyu99 commented Jun 14, 2023

@sanny-io I think we're onboard with you here. Had more talks internally. We'll try to do something to better indicate them in the future :)

Sit tight while we work on a solution with design and engineering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product / functions Fixes and upgrades for the Appwrite Functions.
Projects
None yet
Development

No branches or pull requests

4 participants