Handling the API exceptions

This library provides the basic exception APIException that in the event of exceptional situations can inform the client application of the type of error that occurred in the process of using library methods.
This exception can notify you about two types of exception:

public class APIException extends Exception {

    public static enum Type {

You can get the type of exception that was thrown by using the method APIException.getType().

The type INFO tells the client application that the exception that that has occurred is not critical and is not related to the inability to obtain useful information. The work of the application can be continued after detection of this type of exception without serious consequences but with some adjustments in the future working functionality.

The type REQUEST tells the client application that the exception that has occurred is associated with the process of obtaining useful information from the portal snooker.org or with the inability to handle the received information.
This type of exception can occur for several reasons:

1. The data passed to the API method is incorrect. This can occur in case of an incorrect input ID (tournament, player, etc.) or a null input parameter. In this case the application can continue to work after correction the transmitted parameters.

2. Inaccessibility of the communication channel (access to the portal). Information simply can not be obtained. In this case the client application can not continue to work until an Internet connection is established.

3. The portal API has changed. Incoming data can not be processed correctly. This case is the most significant. It means that the current version of the library can no longer be considered workable. It is necessary to check the availability of a more recent version of the library and if there is none then inform the developer about of a detected nonconformity between API library and portal api.snooker.org.