Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error validation for CRX package manager tools #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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
@@ -109,8 +109,12 @@ do
STATUS=$(echo "${STATUS}" | sed '$d')
"${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