Skip to content

Commit

Permalink
Fail gracefully when trying to load post deployment files from a loca…
Browse files Browse the repository at this point in the history
…l bundle import.
  • Loading branch information
Jeff Pihach committed Sep 27, 2018
1 parent dfe77ef commit 8bae244
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,15 @@ class PostDeployment extends React.Component {
const props = this.props;
const getFile = props.charmstore.getFile;
props.entityURLs.forEach(entityURL => {
const url = urls.URL.fromAnyString(entityURL).toLegacyString();
getFile(url, GET_STARTED, this._handleFileResponse.bind(this, GET_STARTED));
getFile(url, POST_DEPLOYMENT, this._handleFileResponse.bind(this, POST_DEPLOYMENT));
try {
const url = urls.URL.fromAnyString(entityURL).toLegacyString();
getFile(url, GET_STARTED, this._handleFileResponse.bind(this, GET_STARTED));
getFile(url, POST_DEPLOYMENT, this._handleFileResponse.bind(this, POST_DEPLOYMENT));
} catch(e) {
// If the bundleURL is a local file then the url parser could fail
// for a number of reasons. Just carry on if this doesn't parse
// properly.
}
});
}

Expand Down

0 comments on commit 8bae244

Please sign in to comment.