feat(pubsub): expose common errors for easier handling#7940
Conversation
codyoss
left a comment
There was a problem hiding this comment.
Are both of these errors we expect people to handle in their code or are they informational. I would say only expose these if you expect people to check for this error and take an action in code.
| // } | ||
| type PublishResult = ipubsub.PublishResult | ||
|
|
||
| var ErrTopicOrderingNotEnabled = errors.New("Topic.EnableMessageOrdering=false, but an OrderingKey was set in Message. Please remove the OrderingKey or turn on Topic.EnableMessageOrdering") |
There was a problem hiding this comment.
nit: error message should start with a lower case letter. Also other errors in this package seem to prefix with pubsub. Should we do that here too?
There was a problem hiding this comment.
As is, this is to maintain complete backwards compatibility (the error message is completely the same in this case). We didn't standardize on prefixing with pubsub.
I also struggled with fixing this for ErrPublishingPaused, which starts in the middle of the previous error message to allow for error wrapping.
Good question. For For |
|
@codyoss @noahdietz I switched |
Fixes #7925