Out of scope of PR: fixed Client image funcs not returning pointers to Image(s)
Added an extendable pkg "Response Sanitizer" which can take a map of HTTP Response Codes to Custom Messages (or use a default map) which throws an error if the status code is not 200-299. The package is importable in any other external repo. The custom message map can be easily modified or extended at runtime if you choose to add case-specific messages:
What does this fix or implement?
Before
Errors were cut off right where they got interesting
Status codes were manually checked in the client package in an incomplete fashion, with lots of duplicated code
After
Out of scope of PR: Moved the client code in internal pkg (according to https://github.com/golang-standards/project-layout)
Out of scope of PR: fixed Client image funcs not returning pointers to Image(s)
Added an extendable pkg "Response Sanitizer" which can take a map of HTTP Response Codes to Custom Messages (or use a default map) which throws an error if the status code is not 200-299. The package is importable in any other external repo. The custom message map can be easily modified or extended at runtime if you choose to add case-specific messages:
Checklist
feat:
/fix:
/doc:
/test:
/refactor:
)