Skip to content

Commit 3cee9fd

Browse files
committed
Exit on error
1 parent 0afe9b6 commit 3cee9fd

3 files changed

Lines changed: 86 additions & 17 deletions

File tree

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"imports": {
1212
"@deno/dnt": "jsr:@deno/dnt@^0.42.3",
13-
"@mtkruto/mtkruto": "jsr:@mtkruto/mtkruto@^0.76.0"
13+
"@mtkruto/mtkruto": "jsr:@mtkruto/mtkruto@^0.108.0"
1414
},
1515
"exclude": [
1616
"/dist/"

deno.lock

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

main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,19 @@ try {
5454
await client.connect();
5555
console.log("Connected to Telegram.");
5656
} catch (err) {
57-
console.log("Failed to connect to Telegram:", err);
57+
console.log(
58+
"Failed to connect to Telegram:",
59+
err instanceof Error ? err.message : err,
60+
);
61+
Deno.exit(1);
5862
}
5963

6064
try {
6165
await client.signIn();
6266
} catch (err) {
6367
console.log();
6468
console.log("Failed to sign in:", err);
69+
Deno.exit(1);
6570
}
6671

6772
const authString = await client.exportAuthString();

0 commit comments

Comments
 (0)