Browse files

send_system_message raises MessageError if inbox full.

  • Loading branch information...
1 parent 9d44e89 commit e1263edce1e250f330b5020fb9e69dab67f87742 @bsimpson63 bsimpson63 committed Feb 22, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 r2/r2/models/admintools.py
View
7 r2/r2/models/admintools.py
@@ -20,11 +20,13 @@
# Inc. All Rights Reserved.
###############################################################################
+from r2.lib.errors import MessageError
from r2.lib.utils import tup, fetch_things2
from r2.lib.filters import websafe
from r2.lib.log import log_text
from r2.models import Report, Account, Subreddit
+from _pylibmc import MemcachedError
from pylons import g
from datetime import datetime, timedelta
@@ -393,7 +395,10 @@ def send_system_message(user, subject, body):
item.repliable = False
item._commit()
- queries.new_message(item, inbox_rel)
+ try:
+ queries.new_message(item, inbox_rel)
+ except MemcachedError:
+ raise MessageError('reddit_inbox')
try:

0 comments on commit e1263ed

Please sign in to comment.