Create new message with type error to handle serialize and migration errors
Now if we catch serialize error we close client connection. Change this logic with send message with type "error"
{
"type": "error",
"data": {
"_id": "<object_id>",
"error": {
"code": "some code",
"message": "some message"
}
}
}