File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,4 @@ export default function init() {
52
52
} ;
53
53
54
54
client . on ( "error" , errorHandler ) ;
55
- process . on ( "uncaughtException" , errorHandler ) ;
56
- process . on ( "unhandledRejection" , errorHandler ) ;
57
55
}
Original file line number Diff line number Diff line change @@ -8,9 +8,11 @@ const app = express();
8
8
9
9
app . use ( express . static ( path . join ( __dirname , ".." , "public" ) ) ) ;
10
10
11
- app . get ( "/butts" , ( req , res ) => {
12
- res . send ( "butts" ) ;
13
- } ) ;
11
+ /**
12
+ Route handlers and static hosting
13
+ */
14
+
15
+ app . use ( express . static ( path . join ( __dirname , ".." , "public" ) ) ) ;
14
16
15
17
// needs to handle all verbs (GET, POST, etc.)
16
18
app . all (
@@ -32,3 +34,15 @@ app.all(
32
34
app . listen ( process . env . PORT || "3000" ) ;
33
35
34
36
discordBot ( ) ;
37
+
38
+ const errorHandler = ( error : unknown ) => {
39
+ Sentry . captureException ( error ) ;
40
+ if ( error instanceof Error ) {
41
+ console . log ( "ERROR" , error . message ) ;
42
+ } else if ( typeof error === "string" ) {
43
+ console . log ( "ERROR" , error ) ;
44
+ }
45
+ } ;
46
+
47
+ process . on ( "uncaughtException" , errorHandler ) ;
48
+ process . on ( "unhandledRejection" , errorHandler ) ;
You can’t perform that action at this time.
0 commit comments