Unit-tests: error handling