public attr accessor doesn't sound like good idea as I do not except that you want to modify error outside of this module.  I thiunk it should be reader and if you need `error = `internally, then create attr_writter internally.