Skip to content

Commit d1e34b7

Browse files
committed
use a custom error for adl compilation to control whethere tracebacks are shown
1 parent 2867fc3 commit d1e34b7

File tree

3 files changed

+40
-12
lines changed

3 files changed

+40
-12
lines changed

deno.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"lock": "./deno/deno.lock",
33
"tasks" : {
4-
"genadl" : "deno run --check=all --allow-all deno/genadl.ts && cd ts && pnpm install",
4+
"genadl" : "deno run --quiet --check=all --allow-all deno/genadl.ts && cd ts && pnpm install",
55
"build-server-image": "cd rust/server && docker build --tag protoapp-server:latest .",
66
"build-ui-image": "cd ts/ui && docker build --file Dockerfile --tag protoapp-ui:latest .."
77
},
88
"imports": {
99
"@adllang/local-setup": "jsr:@adllang/local-setup@^0.16.0",
1010
"@adllang/adl-runtime": "jsr:@adllang/adl-runtime@^0.1.0",
11-
"@adllang/adlc-tools": "jsr:@adllang/adlc-tools@^0.1.4",
11+
"@adllang/adlc-tools": "jsr:@adllang/adlc-tools@^0.1.5",
1212
"@mesqueeb/case-anything": "jsr:@mesqueeb/case-anything@^3.1.0",
1313
"@std/path": "jsr:@std/path@^1.0.8",
1414
"mustache_ts": "https://deno.land/x/mustache_ts@v0.4.1.1/mustache.ts"

deno/deno.lock

Lines changed: 27 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deno/genadl.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from "@std/path";
2-
import { genRust, genTypescript } from "@adllang/adlc-tools";
2+
import { AdlcError, genRust, genTypescript } from "@adllang/adlc-tools";
33

44
import { genAdlTsPackage } from "./gen-adl-ts-package.ts";
55
import { genCreateSqlSchema } from "./gen-sqlschema.ts";
@@ -93,4 +93,13 @@ export function getRepoRoot(): string {
9393
return path.dirname(path.dirname(modulepath));
9494
}
9595

96-
await main();
96+
try {
97+
await main();
98+
} catch (e: unknown) {
99+
if (e instanceof AdlcError && e.showTraceback === false) {
100+
console.error(e.message);
101+
} else {
102+
console.error(e);
103+
}
104+
Deno.exit(1);
105+
}

0 commit comments

Comments
 (0)