Otherwise we couldn't fetch any error message or code if the dice object is never visible to the user.
Use tiny expression library (from Github) and expand it to provide dice expression parsing. This needs more testing obviously.