Saasli / saasli-backend

Documentation
https://saasli.github.io/docs/
0 stars 0 forks source link

[Event] Fix no matching record errors #35

Closed godd9170 closed 7 years ago

godd9170 commented 7 years ago

whoever though this was a good idea:

# Handler No Triggering Object Id
    if record.get('Id', None) is None: #No triggering object found
        #What do we do here?
        return { "Error" : "No Such Triggering Object Found: %s" %  body['sf_field_value']}

was wrong.

Here's the error that gets returned to the user when they try to associate an event to a record that doesn't exits:

{
  "stackTrace": [
    [
      "/var/task/event/handler.py",
      32,
      "event",
      "if record.get('Id') is None: #No triggering object found"
    ]
  ],
  "errorType": "AttributeError",
  "errorMessage": "'NoneType' object has no attribute 'get'"
}

This is something that is best addressed by whatever ends up coming from #33