Skip to content

Commit

Permalink
remove try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
neptunian committed Nov 20, 2020
1 parent 3b0b0ca commit 7511f99
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions x-pack/plugins/fleet/server/services/epm/packages/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,13 @@ export async function getPackageInfo(options: {
Registry.fetchFindLatestPackage(pkgName),
]);

let paths: string[] | undefined;
let packageInfo: RegistryPackage | ArchivePackage;
try {
const getPackageRes = await getPackageFromSource({
pkgName,
pkgVersion,
pkgInstallSource: savedObject?.attributes.install_source,
});
paths = getPackageRes.paths;
packageInfo = getPackageRes.packageInfo;
} catch (err) {
throw new Error(err);
}
const getPackageRes = await getPackageFromSource({
pkgName,
pkgVersion,
pkgInstallSource: savedObject?.attributes.install_source,
});
const paths = getPackageRes.paths;
const packageInfo = getPackageRes.packageInfo;

// add properties that aren't (or aren't yet) on the package
const updated = {
Expand Down

0 comments on commit 7511f99

Please sign in to comment.