Because a lot of functions in Puppeteer return character data it is hard to set up an error report involving those particular functions. So I would design it so that the system had an error report series of functions. Essentially these could be enabled or disabled easily and while enabled it would create a log of the functions called and the status involving the data of these functions. However even while disabled the programmer should be able to call a class variable that states if something went wrong allowing for cleaner code and less guessing later.
Also allows the enumeration for errors to be clearer.
Things to consider.
- Should this be another class that is used by PuppeteerXML?
- Error File output
- How to incorporate throughout the PuppeteerXML code
- For the error enumerations should that just be a class wide int? should it hold more then one error?
- Can we make it so that an interrupt is called when an error does occur to prevent code from crashing?