Add except block and error message