Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

@next returns zipped content in causeErrors, breaking and complicating error handling #753

Closed
MichalVasak opened this issue Mar 11, 2022 · 3 comments · Fixed by #756
Closed
Assignees

Comments

@MichalVasak
Copy link

Method 'request(options: IRestOptions): Promise ' in zowe/imperative/tree/next/packages/rest/src/client/AbstractRestClient.ts

Returns binary data in causeErrors field of the error response returned when HTTP status code is outside the 200 range.

This is a breaking change from previous versions of imperative (well, so be it) and also means that plugins that need to read the REST response need to convert it to text - so the unzipping is handled by Imperative if responses are in the 200 range, but plugins still need to handle it to get to any error messages returned from a REST API when the status code is higher.

Is this fixable, planned to be fixed, or should plugins work around the issue?

Thanks,
Michal Vasak
Broadcom

@t1m0thyj
Copy link
Member

Thanks for reporting this. I've investigated and it seems that AbstractRestClient only parses content-encoding headers in the case of request success and ignores them on request failure. This should be fixable and I'll start working on a fix.

@t1m0thyj t1m0thyj self-assigned this Mar 11, 2022
@MichalVasak
Copy link
Author

Thank you Timothy, much appreciated!

@t1m0thyj
Copy link
Member

t1m0thyj commented Mar 22, 2022

Fix has been published in @zowe/cli@7.0.0-next.202203211751 and will also be included in the next zowe-v1-lts update

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants