stripe / stripe-cli

A command-line tool for Stripe
https://stripe.com/docs/stripe-cli
Apache License 2.0
1.57k stars 362 forks source link

Add websocket.UnknownMessage #1065

Closed bernerd-stripe closed 1 year ago

bernerd-stripe commented 1 year ago

Reviewers

r? cc @stripe/developer-products

Summary

Instead of always skipping structured messages of an unknonw type with a generic log message, the websocket client will provide them to the configured handler in the Unknown field of the IncomingMessage type.

Existing message handlers already defensively handle unexpected message types by explicitly checking for msg.WebhookEvent or msg.RequestLogEvent.