use a custom exception and increase test coverage