apify-sdk-python icon indicating copy to clipboard operation
apify-sdk-python copied to clipboard

Improve error handling in `Dataset._get_data_internal()`

Open vdusek opened this issue 2 years ago • 0 comments

Simulate this error in Python and handle it accordingly.

    try {
        return await this.client.listItems(options);
    } catch (e) {
        const error = e as Error;
        if (error.message.includes('Cannot create a string longer than')) {
            throw new Error('dataset.getData(): The response is too large for parsing. You can fix this by lowering the "limit" option.');
        }
        throw e;
    }

https://github.com/apify/apify-sdk-python/blob/v1.3.0/src/apify/storages/dataset.py#L240:L249

vdusek avatar Nov 29 '23 15:11 vdusek