Skip to content

Conversation

@marcinus
Copy link

@marcinus marcinus commented Jul 17, 2019

Ensures cqput and cqrun return without success (returncode != 0) when the response from CQ contains inner HTTP code different than 200.
References issue #24

@marcinus marcinus changed the title #24 Better error validation for CRX package manager tools Better error validation for CRX package manager tools Jul 17, 2019
"${API}" -H "${STATUSCODE}"
EXITCODE2=${?}
if [ "${EXITCODE}" -ne 0 -o "${EXITCODE2}" -ne 0 ]
INNERHTTPCODE=$(echo "${STATUS}" | xmllint --xpath "string(//status/@code)" -)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes that xmllint is installed, which may not be the case.

The general idea behind CQ UNIX Toolkit was to avoid external dependencies and rely on built-in commands only (curl, sed, etc).

PS I know that parsing XMLs with sed doesn't sound like fun :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants