signalfx / signalfx-go

Go client library and instrumentation bindings for SignalFx
https://www.signalfx.com
Apache License 2.0
14 stars 48 forks source link

Do not panic on null error message #117

Closed philipnrmn closed 3 years ago

philipnrmn commented 3 years ago

In some circumstances, the signalflow stream server can return error messages with a null message value

{
  "type": "error",
  "error": 400,
  "errorType": "ANALYTICS_INTERNAL_ERROR",
  "message": null
}

signalfx-go will panic in this circumstance because it attempts to cast message, if present, to string. A nil check on the message value avoids the panic.