praekeltfoundation / vumi

Messaging engine for the delivery of SMS, Star Menu and chat messages to diverse audiences in emerging markets and beyond.
BSD 3-Clause "New" or "Revised" License
421 stars 131 forks source link

SMPP transport tear down should gracefully handle errors in set up. #1043

Open hodgestar opened 8 years ago

hodgestar commented 8 years ago

From https://github.com/praekelt/junebug/issues/96:

When deleting an SMPP channel (in this instance it never successfully worked, but I don't know if that's relevant) the following error shows:

{
  "status": 500,
  "code": "Internal Server Error",
  "description": "generic error",
  "result": {
    "errors": [
      {
        "message": "'SmppTransceiverTransport' object has no attribute 'service'",
        "type": "AttributeError"
      }
    ]
  }
}

Likely this is caused by the SMPPService not being set up fully when it was started. See https://github.com/praekelt/vumi/blob/develop/vumi/transports/smpp/smpp_transport.py#L294 for where the error probably occurred.