Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
feat: added crash reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
harryitz committed May 7, 2024
1 parent b200261 commit 867bcde
Show file tree
Hide file tree
Showing 3 changed files with 231 additions and 0 deletions.
219 changes: 219 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"author": "harryc47",
"license": "GPL-3.0-only",
"dependencies": {
"crashreporter": "^1.1.0",
"discord.js": "^14.12.1",
"dotenv": "^16.4.5",
"events": "^3.3.0",
Expand Down
11 changes: 11 additions & 0 deletions src/DiscordNexus.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { MemoryManager } from "./MemoryManager.js";
import { TextFormat } from "./utils/TextFormat.js";
import { CLI } from "./utils/CLI.js";
import { Network } from "./network/Network.js";
import { configure } from "crashreporter";

global.LANGUAGE_PATH = "./src/lang/defaults";

Expand Down Expand Up @@ -190,6 +191,16 @@ export class DiscordNexus extends Client {
if (this.getNexusProperties().get("cron-enable")) {
this.network = new Network(this);
}

const crashDumpsDir = "./crashdumps";
if (!existsSync(crashDumpsDir)) {
mkdirSync(crashDumpsDir);
}
configure({
outDir: crashDumpsDir,
exitOnCrash: true,
hiddenAttributes: ['execPath', 'argv', 'currentDirectory', 'env', 'pid', 'processTitle', 'versions', 'memoryUsage', 'requireCache', 'activeHandle', 'activeRequest']
})

return true;
}
Expand Down

0 comments on commit 867bcde

Please sign in to comment.