mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 08:46:31 +01:00
Set the method to better report a malformed lockfunc rather than to raise a traceback.
This commit is contained in:
parent
22e6cb4f8f
commit
9bab96e0e8
1 changed files with 6 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ from evennia.comms.models import ChannelDB, Msg
|
|||
from evennia.players.models import PlayerDB
|
||||
from evennia.players import bots
|
||||
from evennia.comms.channelhandler import CHANNELHANDLER
|
||||
from evennia.locks.lockhandler import LockException
|
||||
from evennia.utils import create, utils, evtable
|
||||
from evennia.utils.utils import make_iter, class_from_module
|
||||
|
||||
|
|
@ -605,7 +606,11 @@ class CmdClock(COMMAND_DEFAULT_CLASS):
|
|||
self.msg(string)
|
||||
return
|
||||
# Try to add the lock
|
||||
channel.locks.add(self.rhs)
|
||||
try:
|
||||
channel.locks.add(self.rhs)
|
||||
except LockException, err:
|
||||
self.msg(err)
|
||||
return
|
||||
string = "Lock(s) applied. "
|
||||
string += "Current locks on %s:" % channel.key
|
||||
string = "%s\n %s" % (string, channel.locks)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue