add error handling to cli script and simulate errors in service class