forked from rapidsms/rapidsms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Contact.message and Connection.message helpers.
it's a very common request to be able to send a message directly to a contact. there are already many ways, but this seems cleaner and more discoverable.
- Loading branch information
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python | ||
# vim: ai ts=4 sts=4 et sw=4 | ||
|
||
|
||
class MessageSendingError(StandardError): | ||
""" | ||
This exception is raised when an outgoing message cannot be sent. | ||
Where possible, a more specific exception should be raised, along | ||
with a descriptive message. | ||
""" | ||
|
||
|
||
class NoRouterError(MessageSendingError): | ||
""" | ||
This exception is raised when no Router is available to send an | ||
outgoing message. This usually means that it is being sent from the | ||
webui process(es), which is not currently possible in RapidSMS. | ||
""" | ||
|
||
|
||
class NoConnectionError(MessageSendingError): | ||
""" | ||
This execption is raised when a Contact cannot be messaged because | ||
they do not have any Connections. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters