Add some basic exception handling
Add getter for error