Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
set,
} from "./src/commands/mod.ts";
import { getContext } from "./src/context.ts";
import { ApplicationError } from "./src/errors/application.error.ts";

const args = Deno.args
.filter((arg) => arg?.trim())
Expand Down Expand Up @@ -47,6 +48,10 @@ try {
if (error instanceof TypeError) {
console.error(`${brightRed("error")}: ${error.message}`);
Deno.exit(1);
} else if (error instanceof ApplicationError) {
const { exitCode, code, message, name } = error;
console.error(`${brightRed("error")}: ${name} ${code} ${message}`);
Deno.exit(exitCode);
} else {
console.error(error);
Deno.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion src/errors/unsupportedFileKind.error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class UnsupportedFileKindError extends ApplicationError {
super(
ErrorCode.UnsupportedFileKind,
ErrorExitCode.UnsupportedFileKind,
`File ${file} is not a supported kind (csproj)`,
`File ${file} is not a supported kind`,
options,
);
}
Expand Down
Loading