Skip to content

Best practice for error answer? #474

Answered by KSDaemon
SunFulong asked this question in Q&A
Discussion options

You must be logged in to vote

Em... I think this is really up to you as a developer to choose the way.
How does site login RPC differs from idk get the shopping cart one? IDK.

I think this question is the same as the one asked in the context of HTTP REST API: what HTTP status codes should be returned for different operations and cases? Someone prefers to always return 200/OK and then in the body has something like error: true, others return 403/Forbidden and error description in the body. But you can find a plenty examples of both around :)

Here is the same situation. Just choose one approach, describe it in dev docs, and follow it.

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@SunFulong
Comment options

Comment options

You must be logged in to vote
1 reply
@SunFulong
Comment options

Comment options

You must be logged in to vote
5 replies
@SunFulong
Comment options

@KSDaemon
Comment options

@KSDaemon
Comment options

@oberstet
Comment options

@SunFulong
Comment options

Answer selected by SunFulong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #473 on March 28, 2023 19:28.