Tools to Capture and Convert the Web
GrabzIt's Online Community

How to capture 500 and other 5xx server errors with URLToImage?

Ask questions on how to capture or convert web pages or HTML into images, CSV, PDF or DOCX documents as well on how to convert videos into animated GIF's using our API.

I am using the code simillar to https://grabz.it/api/aspnet/advanced/com-object/. The catch handler does catch the 404 error with this returned message "You are trying to take a screenshot of a URL that does not exist! Please enter a URL that is both absolute and public, for instance: http://www.example.com". However when there is a server error, the code still goes through and the image captured is of a Server Error web page. Is there a way for URLToImage to also flag those errors?

Asked by GrabzIt Support on the 14th of June 2019

This message "You are trying to take a screenshot of a URL that does not exist! Please enter a URL that is both absolute and public, for instance: http://www.example.com" is not a 404 error. This occurs for invalid URL formats and if the domain does not exist.

As long as those two criteria are met we capture whatever is found.

Answered by GrabzIt Support on the 14th of June 2019