Skip to content

Commit e582756

Browse files
committed
Update controller text output for error message.
1 parent 6f0ce5c commit e582756

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

MatchingService/controllers/matchingController.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async function getActiveSession(req, res, next) {
5555

5656
}
5757
} catch (error) {
58-
next(error);
58+
await res.status(500).json({ sessionId: null })
5959
}
6060
}
6161

@@ -78,7 +78,7 @@ async function getSession(req, res, next) {
7878

7979
}
8080
} catch (error) {
81-
next(error);
81+
await res.status(500).json({ sessionId: null, session: null});
8282
}
8383
}
8484

@@ -96,7 +96,7 @@ async function endSession(req, res, next) {
9696

9797
}
9898
} catch (error) {
99-
next(error);
99+
await res.status(500).json({ status: 'error', message: 'Failed to end session' });
100100
}
101101
}
102102

@@ -112,7 +112,7 @@ async function cancelMatch(req, res, next) {
112112

113113
}
114114
} catch (error) {
115-
next(error);
115+
await res.status(500).json({ message: 'Failed to cancel match' });
116116
}
117117
}
118118

0 commit comments

Comments
 (0)