4 ms·
I would add one suggestion/comment. Use a known set of standard error codes and not a unique error code/error type for each new situation. Error codes are the
by aleksiy123 2y ago
I would add one suggestion/comment.
Use a known set of standard error codes and not a unique error code/error type for each new situation.
Error codes are there to hint to clients/callers what action they should potentially take (retry?, backoff)
Don't make callers handle 100s of different potential error codes/types.
If the whole internet can work with 70 your app can work with less.
All of google uses less than 20
https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto https://github.com/googleapis/googleapis/blob/master/google/...
Put more specific information in the error message or a secondary status code.