raise exceptions in error cases