Skip to content

When there's an error in decoding a message, the resulting error will be ignored by Socket #86

@divillysausages

Description

@divillysausages

In index.js, if there's an error decoding a message for whatever reason (e.g. malformed JSON), then the method error() will be called, returning:

function error() {
  return {
    type: exports.ERROR,
    data: 'parser error'
  };
}

However, when it eventually gets to Socket, the message will be ignored as the nsp property doesn't matched (as it's not set):

Socket.prototype.onpacket = function (packet) {
  if (packet.nsp !== this.nsp) return;

Is this an oversight, or is there a way to get this event (emit it on the default namespace?)? From what I can tell Manager doesn't have a generic error event

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions