Skip to content

Commit

Permalink
try/catch around getKibanaBranch
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Jul 29, 2020
1 parent 65d2074 commit d49f968
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ const SNAPSHOT_REGISTRY_URL_CDN = 'https://epr-snapshot.elastic.co';
// const SNAPSHOT_REGISTRY_URL_NO_CDN = 'https://epr-snapshot.ea-web.elastic.dev';

const getDefaultRegistryUrl = (): string => {
const branch = appContextService.getKibanaBranch();
let branch;
try {
branch = appContextService.getKibanaBranch();
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
}

if (branch === 'master') {
return SNAPSHOT_REGISTRY_URL_CDN;
} else {
Expand Down

0 comments on commit d49f968

Please sign in to comment.