0

I'm working on a gRPC API that has a database with an endpoint to return a record back to the consumer. One of the columns is an enum string {X|Y|Z}. When returning the record, I reverse map the enum to an int. IF someone edits the data to maliciously insert 'M' into the column, the reverse mapping fails. In this case, what's the gRPC error code that needs to be returned? DATA_LOSS or FAILED_PRECONDITION or INTERNAL ? As per the Unrecoverable data loss or corruption.. Does this mean, data is not longer recoverable by any means or the API was not able to act based on the data it fetched from the db?

noob-dev
  • 59
  • 1
  • 7

0 Answers0