mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-12-27 22:18:52 +00:00
Improve error messages format
This commit is contained in:
parent
7f82128c71
commit
92340bbc33
@ -175,7 +175,10 @@ export class UserWebSocketController {
|
||||
|
||||
// Try again to send again a response
|
||||
try {
|
||||
handler.sendResponse("error", "Server error.");
|
||||
handler.sendResponse("error", {
|
||||
code: 500,
|
||||
message: "Server error"
|
||||
});
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
@ -30,7 +30,10 @@ export class UserWebSocketRequestsHandler extends BaseRequestsHandler {
|
||||
}
|
||||
|
||||
public error(code: number, message: string): void {
|
||||
this.sendResponse("error", code + " - " + message);
|
||||
this.sendResponse("error", {
|
||||
code: code,
|
||||
message: message
|
||||
});
|
||||
throw new Error("An error occured while processing user WS request!");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user