Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Bug 1268329 - Removed a WARN in server.log when uploading a Bundle vi…
Browse files Browse the repository at this point in the history
…a URL when using the special token handling worflow.
  • Loading branch information
josejulio committed Jun 27, 2016
1 parent b5ab4f5 commit 059a43f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
Expand Up @@ -302,18 +302,10 @@ public void onFailure(Throwable caught) {
}

private BundleNotFoundException unpackBundleNotFoundException(Throwable caught) {
if (caught instanceof RuntimeException) {
if (caught instanceof BundleNotFoundException) {
String message = caught.getMessage();
int patternStart = message.indexOf(BUNDLE_NOT_FOUND_EXCEPTION_PATTERN_START);
if (patternStart > -1) {
int patternEnd = message.indexOf(BUNDLE_NOT_FOUND_EXCEPTION_PATTERN_END,
patternStart + BUNDLE_NOT_FOUND_EXCEPTION_PATTERN_START.length());
if (patternEnd > -1) {
return new BundleNotFoundException(
message.substring(
patternStart + BUNDLE_NOT_FOUND_EXCEPTION_PATTERN_START.length(),
patternEnd));
}
if (message.startsWith("[") && message.endsWith("]")) {
return new BundleNotFoundException(message.substring(1, message.length()-1));
}
}
return null;
Expand Down
Expand Up @@ -29,6 +29,7 @@
import org.rhq.core.domain.bundle.BundleDestination;
import org.rhq.core.domain.bundle.BundleFile;
import org.rhq.core.domain.bundle.BundleGroup;
import org.rhq.core.domain.bundle.BundleNotFoundException;
import org.rhq.core.domain.bundle.BundleResourceDeployment;
import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory;
import org.rhq.core.domain.bundle.BundleType;
Expand Down Expand Up @@ -74,6 +75,10 @@ public BundleVersion createOrStoreBundleVersionViaURL(String url, String usernam
BundleVersion results = bundleManager.createOrStoreBundleVersionViaURL(getSessionSubject(), url, username,
password);
return SerialUtility.prepare(results, "createOrStoreBundleVersionViaURL");
} catch (BundleNotFoundException bnfe) {
// don't log this exception, just throw it as is required for the 'special token handling worflow.
// See BZ-1268329 for more info.
throw bnfe;
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
}
Expand Down

0 comments on commit 059a43f

Please sign in to comment.