For example, if I query the state of a pjlink device with an incorrect address I get the following log trace from the AV-API:
2017/05/24 03:07:41 Sending requqest to http://localhost:8012/0.0.0.0/power/status
2017/05/24 03:07:41 Microservice returned: "error dialing address : dial tcp 0.0.0.0:53595: getsockopt: connection refused"
2017/05/24 03:07:41 Error unmarshalling response from D1
2017/05/24 03:07:41 Sending requqest to http://localhost:8012/0.0.0.0/volume/mute/status
2017/05/24 03:07:41 Microservice returned: "error dialing address : dial tcp 0.0.0.0:53595: getsockopt: connection refused"
2017/05/24 03:07:41 Error unmarshalling response from D1
2017/05/24 03:07:41 Sending requqest to http://localhost:8005/0.0.0.0/input/current
2017/05/24 03:07:41 Microservice returned: "failed to establish a connection with pjlink device. error msg: dial tcp 0.0.0.0:4352: getsockopt: connection refused"
2017/05/24 03:07:41 Error unmarshalling response from D1
2017/05/24 03:07:41 Sending requqest to http://localhost:8012/0.0.0.0/volume/level
2017/05/24 03:07:41 Microservice returned: "error dialing address : dial tcp 0.0.0.0:53595: getsockopt: connection refused"
2017/05/24 03:07:41 Error unmarshalling response from D1
2017/05/24 03:07:41 Writing output to channel...
2017/05/24 03:07:41 outputs from device ITB-1006-D1
2017/05/24 03:07:41 outputs from device ITB-1006-D1
2017/05/24 03:07:41 outputs from device ITB-1006-D1
2017/05/24 03:07:41 outputs from device ITB-1006-D1
2017/05/24 03:07:41 Done acquiring statuses from ITB-1006-D1
2017/05/24 03:07:41 Done. Closing channel...
2017/05/24 03:07:41 Error querying status with destination: D1
2017/05/24 03:07:41 Publishing event: {"hostname":"ITB-1101-CP3","timestamp":"2017-05-24T03:07:41Z","localEnvironment":true,"event":{"type":0,"eventCause":3,"device":"CP3","eventInfoKey":"Error String","eventInfoValue":"Error querying status for destinationD1:json: cannot unmarshal string into Go value of type map[string]interface {}"},"building":"ITB","room":"1101"}
2017/05/24 03:07:41 Appending results of D1 to output
2017/05/24 03:07:41 Error querying status with destination: D1
2017/05/24 03:07:41 Publishing event: {"hostname":"ITB-1101-CP3","timestamp":"2017-05-24T03:07:41Z","localEnvironment":true,"event":{"type":0,"eventCause":3,"device":"CP3","eventInfoKey":"Error String","eventInfoValue":"Error querying status for destinationD1:json: cannot unmarshal string into Go value of type map[string]interface {}"},"building":"ITB","room":"1101"}
2017/05/24 03:07:41 Appending results of D1 to output
2017/05/24 03:07:41 Error querying status with destination: D1
2017/05/24 03:07:41 Publishing event: {"hostname":"ITB-1101-CP3","timestamp":"2017-05-24T03:07:41Z","localEnvironment":true,"event":{"type":0,"eventCause":3,"device":"CP3","eventInfoKey":"Error String","eventInfoValue":"Error querying status for destinationD1:json: cannot unmarshal string into Go value of type map[string]interface {}"},"building":"ITB","room":"1101"}
2017/05/24 03:07:41 Appending results of D1 to output
2017/05/24 03:07:41 Error querying status with destination: D1
2017/05/24 03:07:41 Publishing event: {"hostname":"ITB-1101-CP3","timestamp":"2017-05-24T03:07:41Z","localEnvironment":true,"event":{"type":0,"eventCause":3,"device":"CP3","eventInfoKey":"Error String","eventInfoValue":"Error querying status for destinationD1:json: cannot unmarshal string into Go value of type map[string]interface {}"},"building":"ITB","room":"1101"}
2017/05/24 03:07:41 Appending results of D1 to output
2017/05/24 03:07:41 Evaluating responses...
But in the error that is published doesn't include this information it includes a much more generic error:
"Error String","eventInfoValue":"Error querying status for destinationD1:json: cannot unmarshal string into Go value of type map[string]interface {}"}
We need to find a way to report the error that the microservice returned in the event.
This is a two fold thing
For example, if I query the state of a pjlink device with an incorrect address I get the following log trace from the AV-API:
You'll notice that we get a good error here:
Microservice returned: "failed to establish a connection with pjlink device. error msg: dial tcp 0.0.0.0:4352: getsockopt: connection refused"But in the error that is published doesn't include this information it includes a much more generic error:
"Error String","eventInfoValue":"Error querying status for destinationD1:json: cannot unmarshal string into Go value of type map[string]interface {}"}We need to find a way to report the error that the microservice returned in the event.