Add tests for cursor error exception