travis-g / dice-golem

A Discord bot for rolling dice
https://dicegolem.io
Apache License 2.0
6 stars 0 forks source link

send a specific error message for dice of invalid sizes #10

Closed travis-g closed 2 years ago

travis-g commented 4 years ago

invalid size parsing errors can be handled with a custom friendly error message.

errors during parsing: [parsing dice "d100000000000000000000000000000000000": invalid size]
{"level":"error","ts":"2020-03-17T17:38:15.793Z","caller":"dice-golem/main.go:432","msg":"evaluation error","expression":"d100000000000000000000000000000000000","error":"errors during parsing: [parsing dice \"d100000000000000000000000000000000000\": invalid size]","stacktrace":"main.RouteMessage\n\t/Users/t/go/src/github.com/travis-g/dice-golem/main.go:432\nmain.HandleMessageCreate\n\t/Users/t/go/src/github.com/travis-g/dice-golem/main.go:338\ngithub.com/bwmarrin/discordgo.messageCreateEventHandler.Handle\n\t/Users/t/go/src/github.com/bwmarrin/discordgo/eventhandlers.go:497"}