m0nhawk/grafana_api

grafana_api does not pass errors to caller anymore

bzed opened this issue · 2 comments

bzed commented

Describe the bug

in grafana_api.py, line 114:
            except Exception as error:
                print('Caught this error: ' + repr(error))

you are catching all exceptions you were throwing before - with the result, that all issues are hidden to the code that actually uses grafana_api. This is pretty much broken.

According to the commit, this is supposed to fix unit tests. If this fixes unit tests, they are also broken...

Expected would be that the errors are being raised.

bzed commented

Broken with ed68677

bzed commented

You actually need to distinguish between errors you might want to hide (like find_organization returning 404 if the org was not found) and errors which show an error on the grafana side (503 for example - you want to fail if grafana does not work at all instead of returning a broken response (==None).