Closed mabdi3 closed 4 years ago
Closing this since we need to keep our errors as statuses for gRPC (see here, and we're hiding them from the users now after https://github.com/googleinterns/cloud-operations-api-mock/pull/19. We should still figure out a better way of testing these errors (that's the only reason we're exporting the statuses anyways), which can be done in https://github.com/googleinterns/cloud-operations-api-mock/issues/22
~Following https://blog.golang.org/go1.13-errors, we want to refactor
ErrMissingField
as a struct, where we override theError()
, like so:~EDIT: ~Instead, we're going to try and handle errors more gracefully.~ We're just going to keep the error handling the way it is now, and hide it to users of the api. See here. In addition, we can replace the string checking for determining errors with ID checking instead since string comparisons are very brittle. Issue linked here.