Rudimentary error handling