More specific errors and fixes for selector screenshots

Fewer requests fail with internal_application_error: network failures get the same errors as on the first load, clip selector screenshots scroll to the element, and other failures get specific errors or succeed.

Changelog3 min read

Written by

Dmytro Krasun

Published on

Some requests failed with the internal_application_error error, although we could name the cause: the site couldn’t be reached, the element had no size, or the storage endpoint didn’t serve the bucket. Others failed because of bugs in how we took the screenshot. These requests now get a specific error or succeed.

As a result, some errors change their code or HTTP status, and some selector screenshots of scrolled pages change their content. If you handle errors in your code or compare screenshots, check the changes below.

Network failures

When the browser shows its own error page because a page couldn’t load, for example, after the page navigated to another address by itself or didn’t respond in time, you now get the same error as when the first request fails:

  • network_error (HTTP 500) when the connection is refused, reset, or times out. Before, these requests failed with internal_application_error.
  • name_not_resolved (HTTP 400) when the domain doesn’t resolve. Before, it was network_error (HTTP 500).

As on the first load, the API can retry a request with network_error once before returning the error, so these requests can take longer to fail. It doesn’t retry name_not_resolved.

Selector screenshots with the clip algorithm

Screenshots with selector_algorithm=clip now show the requested element in more cases:

  • With capture_beyond_viewport=false, the page is now scrolled to an element that isn’t visible at all, as selector_scroll_into_view describes. These requests return a screenshot instead of the internal_application_error error. A partly visible element isn’t scrolled to, so its screenshot shows its visible part, as before.
  • On pages that are already scrolled when the screenshot is taken, for example, by an anchor in the URL, scroll_into_view, click, or the page’s own scripts, the screenshot now shows the element. Before, it could show another part of the page or fail.

With the default capture_beyond_viewport=true, the page still isn’t scrolled.

Other errors

  • Elements too small to capture. When a screenshot by selector rounds down to zero width or height because the element is smaller than a pixel, you now get selector_not_found (HTTP 400), as documented, instead of internal_application_error.
  • Hovers over elements without a box. A hover over an element that the browser can’t point at, for example, one with display: contents, is treated as not found. You get selector_not_found, or, with error_on_hover_selector_not_found=false, the hover is skipped. Before, it failed with internal_application_error.
  • Storage. If the bucket’s address on your storage_endpoint, the bucket name as a subdomain of the endpoint, doesn’t exist while the endpoint itself resolves, for example, on a Cloudflare quick tunnel, you now get invalid_storage_configuration (HTTP 400) instead of internal_application_error. If a DNS lookup for your storage reports a temporary failure, you now get storage_returned_transient_error (HTTP 500) instead of invalid_storage_configuration or internal_application_error. Other DNS failures are reported as before.
  • Very large images. Screenshots too large to process now return resulting_image_too_large (HTTP 400) instead of internal_application_error.

Fixed failures

These requests failed with internal_application_error and now succeed:

Requests that now succeed, including the selector screenshots above, count toward your quota like any other screenshot.

If you handle errors in code

  • name_not_resolved, selector_not_found, invalid_storage_configuration, and resulting_image_too_large are HTTP 400 errors. The API doesn’t retry them, and retrying right away usually gives the same error. Check the cause first: the same request can succeed later once the cause is gone, for example, after a new domain’s DNS records become available or you fix your storage settings.
  • network_error and storage_returned_transient_error are HTTP 500 errors that you can retry. The API may already have retried a network_error once before returning it.

As before, failed requests don’t count toward your quota. If you see an error you don’t expect, please contact support@screenshotone.com.

Read more product updates

New features, bug fixes, and optimizations...

View all product updates
Added an Above-the-Fold Checker Tool

Added an Above-the-Fold Checker Tool

A new ScreenshotOne tool to capture what users see before the first scroll.

Read more

1 min read

Screenshot hard limits by plan

Screenshot hard limits by plan

Set your monthly screenshot limit directly in Billing, with maximums based on your plan.

Read more

1 min read

Improved blocking of banners and popups

Improved blocking of banners and popups

Improved generic algorithm to bypass blockers and better banner exclusion heuristics.

Read more

1 min read

Automate website screenshots

Exhaustive documentation, ready SDKs, no-code tools, and other automation to help you render website screenshots and outsource all the boring work related to that to us.