Class ApiException

java.lang.Object
java.lang.Throwable
java.lang.Exception
ai.nextbillion.maps.errors.ApiException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AccessNotConfiguredException, InvalidRequestException, MaxElementsExceededException, MaxRouteLengthExceededException, MaxWaypointsExceededException, NotFoundException, OverDailyLimitException, OverQueryLimitException, RequestDeniedException, UnknownErrorException, ZeroResultsException

public class ApiException
extends java.lang.Exception
ApiException and its descendants represent an error returned by the remote API. API errors are determined by the status field returned in any of the Geo API responses.
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected ApiException​(java.lang.String message)  
  • Method Summary

    Modifier and Type Method Description
    static ApiException from​(java.lang.String status, java.lang.String errorMessage)
    Construct the appropriate ApiException from the response.

    Methods inherited from class java.lang.Throwable

    addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ApiException

      protected ApiException​(java.lang.String message)
  • Method Details

    • from

      public static ApiException from​(java.lang.String status, java.lang.String errorMessage)
      Construct the appropriate ApiException from the response. If the response was successful, this method will return null.
      Parameters:
      status - The status field returned from the API
      errorMessage - The error message returned from the API
      Returns:
      The appropriate ApiException based on the status or null if no error occurred.