sensu / sensu-remediation-handler

Sensu Go handler for implementing "self healing" workflows
MIT License
2 stars 5 forks source link

Improved error handling for HTTP 401s and 404s #1

Closed calebhailey closed 5 years ago

calebhailey commented 5 years ago

No more inscrutable error message! Here's some example output:

$ SENSU_PASS=nope ./sensu-go-remediation-handler < testing/data/example-event.json
2019/04/02 16:39:26 Requesting the "remediation-1" remediation action on the "[entity:21b4467341ad]" subscription(s).
2019/04/02 16:39:26 ERROR: 401 Unauthorized (please check your access credentials)
$ ./sensu-go-remediation-handler < testing/data/example-event.json
2019/04/02 16:39:30 Requesting the "remediation-1" remediation action on the "[entity:21b4467341ad]" subscription(s).
2019/04/02 16:39:30 ERROR: 404 Not Found (http://127.0.0.1:8080/api/core/v2/namespaces/default/checks/remediation-1/execute); no check named "remediation-1" found in namespace "default".