code: func unwrapError(err error, md metadata.MD) error {
  	if err == nil {
  		return nil
  	}
  	if errTypeStrs, ok := md["errortype"]; ok {
  		unwrappedErr := grpc.ErrorDesc(err)
  		if len(errTypeStrs) != 1 {
  			return berrors.InternalServerError(
  				"multiple errorType metadata, wrapped error %q",
  				unwrappedErr,
  			)
  		}
  		errType, decErr := strconv.Atoi(errTypeStrs[0])
  		if decErr != nil {
  			return berrors.InternalServerError(
  				"failed to decode error type, decoding error %q, wrapped error %q",
  				decErr,
  				unwrappedErr,
  			)
  		}
  		return berrors.New(berrors.ErrorType(errType), unwrappedErr)
  	}
  	return err
  }
docs: // unwrapError unwraps errors returned from gRPC client calls which were wrapped
  // with wrapError to their proper internal error type. If the provided metadata
  // object has an "errortype" field, that will be used to set the type of the
  // error.