When a rule encounters an error, it should raise the following exception, setting tool to a string describing the current tool and msg to a diagnostic string describing the nature of the error:
exception ToolError of { tool: string, msg: string }