mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 10:49:20 +00:00
Formatted code and clean up
This commit is contained in:
+6
-12
@@ -1,19 +1,13 @@
|
||||
import { CustomError } from 'ts-custom-error'
|
||||
|
||||
import { CustomError } from 'ts-custom-error';
|
||||
|
||||
export class ServiceError extends CustomError {
|
||||
public constructor(
|
||||
public statusCode: number,
|
||||
message: string
|
||||
) {
|
||||
super(message)
|
||||
public constructor(public statusCode: number, message: string) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
||||
export class DatabaseError extends CustomError {
|
||||
public constructor(
|
||||
message: string
|
||||
) {
|
||||
super(message)
|
||||
public constructor(message: string) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import Logger from '../libs/Logger';
|
||||
|
||||
import App from '../providers/App';
|
||||
|
||||
class NativeException {
|
||||
|
||||
public process (): void {
|
||||
|
||||
process.on('uncaughtException', exception => {
|
||||
public process(): void {
|
||||
process.on('uncaughtException', (exception) => {
|
||||
Logger.log('critical', 'Critical error, cleaning up and exiting');
|
||||
Logger.log('critical', exception.stack);
|
||||
|
||||
@@ -14,11 +10,10 @@ class NativeException {
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on('unhandledRejection', exception => {
|
||||
process.on('unhandledRejection', (exception) => {
|
||||
throw exception;
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export default new NativeException;
|
||||
export default new NativeException();
|
||||
|
||||
Reference in New Issue
Block a user