-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[AMBARI-23032] fix exceptions, export cluster settings and single mpack #431
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
Changes from all commits
63083ec
4ec0391
bd2f0b3
33c0f20
aba404a
c31829c
91f1560
eb370a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,12 +159,15 @@ public RequestStatus createResourcesAuthorized(final Request request) | |
| associatedResources.add(resource); | ||
| return getRequestStatus(null, associatedResources); | ||
| } | ||
| } catch (IOException e) { | ||
| if (e instanceof ConnectException) | ||
| throw new SystemException("The Mpack Uri : " + mpackRequest.getMpackUri() + " is not valid. Please try again"); | ||
| e.printStackTrace(); | ||
| } catch (BodyParseException e1) { | ||
| e1.printStackTrace(); | ||
| } | ||
| catch (ConnectException e) { | ||
| throw new SystemException("The Mpack Uri: " + mpackRequest.getMpackUri() + " is not valid. Please try again", e); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't a ConnectException also sometimes occur for a valid URI that happens to not be reachable with the given connection? Its not a big deal for now, but maybe we should consider changing the error message here to make the error cause a little clearer.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed it could be improved. The reason why I made this change is that the original code was swallowing exceptions and I could only see an NPE thrown elsewhere and had to spend time debugging what was actually happening. |
||
| } | ||
| catch (IOException e) { | ||
| throw new SystemException("I/O exception occured during installing mpack: " + mpackRequest.getMpackUri(), e); | ||
| } | ||
| catch (BodyParseException e) { | ||
| throw new SystemException("Invalid mpack registration request", e); | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this query work for clusters that have been created by the Ambari UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I am testing it with a cluster that has been created via UI.