wcmio-content-package-maven-plugin swallows JSON upload error

Description

The code specifically checks the "success"-attribute in the JSON response. If that is not true, it checks the message for package existence, but then if that is not true, it reports an error. That error comes from the JSON object; which is not correct.

I would rather see the full JSON that was returned + the HTTP status code.

1 2 3 4 5 6 7 8 9 10 11 12 boolean success = jsonResponse.optBoolean("success", false); String msg = jsonResponse.optString("msg", null); String path = jsonResponse.optString("path", null); if (success) { ... } else if ((StringUtils.startsWith(msg, "Package already exists: ")) && (!this.force)) { getLog().info("Package skipped because it was already uploaded."); } else { throw new MojoExecutionException("Package upload failed: " + msg); }

Environment

None

Status

Assignee

Unassigned

Reporter

Henry Kuijpers

Labels

None

Components

Fix versions

Priority

Major
Configure