mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-12-28 14:38: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 again to send again a response
|
||||||
try {
|
try {
|
||||||
handler.sendResponse("error", "Server error.");
|
handler.sendResponse("error", {
|
||||||
|
code: 500,
|
||||||
|
message: "Server error"
|
||||||
|
});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,10 @@ export class UserWebSocketRequestsHandler extends BaseRequestsHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public error(code: number, message: string): void {
|
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!");
|
throw new Error("An error occured while processing user WS request!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user