From c196689545ead08fd529c04ae287126567eb4d3f Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Thu, 16 Dec 2021 22:59:31 +0100 Subject: [PATCH] docs: fix basic crud example Related: https://github.com/socketio/socket.io/issues/4213 --- examples/basic-crud-application/server/lib/util.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/basic-crud-application/server/lib/util.ts b/examples/basic-crud-application/server/lib/util.ts index 843c0b309a..e329b32004 100644 --- a/examples/basic-crud-application/server/lib/util.ts +++ b/examples/basic-crud-application/server/lib/util.ts @@ -7,8 +7,8 @@ export enum Errors { const errorValues: string[] = Object.values(Errors); -export function sanitizeErrorMessage(message: string) { - if (errorValues.includes(message)) { +export function sanitizeErrorMessage(message: any) { + if (typeof message === "string" && errorValues.includes(message)) { return message; } else { return "an unknown error has occurred";