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

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

I am using the code simillar to https://grabz.it/api/aspnet/advanced/comobject.aspx. 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 Friday, 14 June, 2019 01:45:01 PM

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 Friday, 14 June, 2019 01:59:44 PM