getError

String getError ( )

Description

Gets any error message, or returns null if there was no error

Parameters

This method takes no parameters

Return Value

The error message returned

Error messages

  • OK Nothing went wrong
  • BALANCE_ERROR Insufficient funds with paid service
  • NETWORK_ERROR General network error (timeout, lost connection, server busy, etc...)
  • INVALID_LOGIN Credentials are invalid
  • GENERAL_ERROR General error, possibly image was bad or the site couldn't resolve it. See the error message for details
  • UNKNOWN Unknown error

Change Log

Version Description
5.5.29a Available in all editions.

Examples

Convert an image to text

 import com.screenscraper.util.images.*;

 // Assuming an ImageDecoder was created in a different location and saved in "IMAGE_DECODER"
 ImageDecoder decoder = session.getVariable("IMAGE_DECODER");
 DecodedImage result = decoder.decodeFile("someFile.jpg");

 if(result.wasError())
 {
   session.logWarn("Error converting image to text: " + result.getError());
 }
 else
 {
   session.log("Decoded Text: " + result.getResult());
 }

 // If the result was bad
 result.reportAsBad();