Error handling: using try and catch