110 |
DiscordClient.client = this; |
DiscordClient.client = this; |
111 |
|
|
112 |
this.config = new Config(this); |
this.config = new Config(this); |
113 |
this.db = new Database(path.resolve(rootdir, 'database.db'), this); |
this.db = new Database(this); |
114 |
this.serviceManager = new ServiceManager(this, this.aliases); |
this.serviceManager = new ServiceManager(this, this.aliases); |
115 |
this.serviceManager.load(this.services); |
this.serviceManager.load(this.services); |
116 |
|
|
155 |
|
|
156 |
async handleCrash(error: Error, origin: NodeJS.UncaughtExceptionOrigin) { |
async handleCrash(error: Error, origin: NodeJS.UncaughtExceptionOrigin) { |
157 |
console.log('here'); |
console.log('here'); |
158 |
await appendFile(path.resolve(__dirname, "..", "..", "logs", "error.log"), `Uncaught ${error.name}: ${error.message}\n${error.stack}`); |
await appendFile(path.join(process.env.SUDO_PREFIX ?? (__dirname + "/../../"), "logs", "error.log"), `Uncaught ${error.name}: ${error.message}\n+ ${error.stack}`); |
159 |
await this.debugLogger.logToHomeServer(`Uncaught ${error.name}: ${error.message}\n${error.stack}`); |
await this.debugLogger.logToHomeServer(`Uncaught ${error.name}: ${error.message}\n${error.stack}`); |
160 |
} |
} |
161 |
} |
} |