ImageGear for Java
Warnings and Errors

ImageGear for Java uses the Java exception handling model and reports exceptional conditions and errors by throwing an exception containing specific information about the condition or error. It is important to note that not only can instances of ImageGear for Java exception classes can be thrown from ImageGear for Java code, but instances of exception classes defined by the Java language can be thrown.

ImageGear defines the ImGearException class to represent errors and exceptional conditions during execution of its code. Although this class has a public constructor, the throwError method may also be used to create and throw an exception, providing it with an appropriate value from the ImGearErrorCodes Enumeration.

The ImGearException Class is used to report critical errors (i.e., when incorrect parameters are specified or internal errors occur). However, to report minor and non-critical mistakes (i.e., an inconsistency of the metadata or image attributes in ImGearPage Class entered into the savePage Method of the ImGearFileFormats Class), the toolkit uses two other types, the ImGearWarning class and the IImGearAddWarning interface. To use this functionality, the developer should create a class that implements the ImGearAddWarning interface and override the invoke method. Then, the developer should use the ImGearWarning.setAddWarning method to specify an instance of their IImGearAddWarning implementation will be used when a warning is reported. When a warning is reported, the invoke method of IImGearAddWarning will be invoked.

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback