openfaas / connector-sdk

SDK for connecting events to functions
MIT License
54 stars 25 forks source link

Consistent use of log.Fatal instead of panic #44

Closed embano1 closed 4 years ago

embano1 commented 4 years ago

As discussed with @alexellis in #6 the use of log.Fatal is encouraged in specific cases. However, GetCredentials in types/credentials.go uses panic and misses the properly formatted log statement.

This PR:

The PR was tested via invoking ./tester against the most recent faas-netes after running make.

Signed-off-by: Michael Gasch mgasch@vmware.com

alexellis commented 4 years ago

Sounds good to me, I've left a note and think we can improve even further. If you agree, would you like me to merge this then send another PR or wait for an amendment?

embano1 commented 4 years ago

I'm +1 for bubbling these errors up instead of exiting. However, in #6 we discussed that this might be ok. Suggestion: leave this PR as is and create a new issue which addresses the general error handling in the library. I can work on that. Will be a breaking change to the SDK though due to different function signatures.