LivePersonInc / node-agent-sdk

LivePerson Agent Messaging SDK for NodeJS
MIT License
49 stars 78 forks source link

New Exception when a Notification/Response contains wrong JSON. #90

Closed eplazaso closed 5 years ago

eplazaso commented 5 years ago

This will throw an error that contains the UMS notification payload that caused the exception. This is necessary for error handling and investigation when the UMS events don't contain the expected data or some information is missed.

ohassidi commented 5 years ago

You have duplicated code (that was before) but if changing why not put in one function?

try {
  msg = Transformer[msg.type](msg, this);
}catch(error) {
  throw new TransformError(error, msg);
}