Adding a basic error checking framework