I am used to write Rest API endpoints, wherein we insert error codes like 400 directly in the response.
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
I have a piece of golang code(part of gRPC API) returning an error, like:
status.Errorf(codes.FailedPrecondition, ...custom error)
How do we map it to status 400?