Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.roll/.dice breaks if called without arguments. #624

Closed
creftos opened this issue Sep 28, 2014 · 0 comments
Closed

.roll/.dice breaks if called without arguments. #624

creftos opened this issue Sep 28, 2014 · 0 comments

Comments

@creftos
Copy link
Contributor

creftos commented Sep 28, 2014

An exception is thrown if you try to call .roll or .dice:

(4:57:10 PM) creftos: .dice
(4:57:10 PM) Willie: TypeError: expected string or buffer (file "/usr/lib64/python2.7/re.py", line 177, in findall)

And in the logs:

    Traceback (most recent call last):
      File "/home/bdc/workspace/willie/willie/bot.py", line 741, in call
        exit_code = func(willie, trigger)
      File "/home/bdc/workspace/willie/willie/modules/dice.py", line 175, in roll
        dice_expressions = re.findall(dice_regexp, arg_str)
      File "/usr/lib64/python2.7/re.py", line 177, in findall
        return _compile(pattern, flags).findall(string)
    TypeError: expected string or buffer

Instead of throwing an exception, Willie should fail gracefully and inform the user of the kind of input that is expected.

Additional Information:
Willie v. 4.5.1
OS: Fedora release 20 (Heisenbug)
Kernel Version: 3.16.2-201.fc20.x86_64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant