Skip to content

Commit

Permalink
refactor: remove unecessary try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
ComradeVanti committed Dec 20, 2023
1 parent b6c5f52 commit 7dba803
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import log from "./logger";

// update-notifier
import pkg from "../package.json";
import { assertIsError } from "./utils/error-type-guards";
import { eachValue, mustBeParceable, mustSatisfy } from "./cli-parsing";
import { isPackageReference } from "./types/package-reference";
import { isDomainName } from "./types/domain-name";
Expand Down Expand Up @@ -152,14 +151,8 @@ program
)
.description("authenticate with a scoped registry")
.action(async function (options) {
try {
const retCode = await login(makeCmdOptions(options));
if (retCode !== 0) process.exit(retCode);
} catch (err) {
assertIsError(err);
log.error("", err.message);
process.exit(1);
}
const retCode = await login(makeCmdOptions(options));
if (retCode !== 0) process.exit(retCode);
});

// prompt for invalid command
Expand Down

0 comments on commit 7dba803

Please sign in to comment.