Package org.botblock.javabotblockapi.exceptions

## Class RatelimitedException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.botblock.javabotblockapi.exceptions.RatelimitedException

- All Implemented Interfaces:
    `Serializable`

      public class RatelimitedException
      extends RuntimeException

  Indicates that the Wrapper got rate limited by the BotBlock API.
  Use `getDelay()` to find out how long you have to wait until you can perform another request towards `the targeted route`.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `RatelimitedException​(String response)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `getBotId()` | Returns the bot id that was rate limited.
    `int` | `getDelay()` | Returns the delay - in milliseconds - you have to wait to perform a request again.
    `String` | `getIp()` | Returns the ip that was rate limited.
    `String` | `getMessage()` | Returns a formatted message displaying the various information returned in this exception.
    `String` | `getRoute()` | Returns the route on which the bot was rate limited.
    `String` | `toString()` | Returns this class formatted to a String.

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### RatelimitedException

          public RatelimitedException​(String response)

  - ### Method Detail

    - #### getDelay

          public int getDelay()

      Returns the delay - in milliseconds - you have to wait to perform a request again.
      Returns:
        The delay you have to wait in milliseconds

    - #### getBotId

          public String getBotId()

      Returns the bot id that was rate limited.
      Returns:
        The id of the bot that was rate limited

    - #### getIp

          public String getIp()

      Returns the ip that was rate limited.
      Returns:
        The ip that was rate limited

    - #### getRoute

          public String getRoute()

      Returns the route on which the bot was rate limited.
      Returns:
        The route on which the bot was rate limited

    - #### toString

          public String toString()

      Returns this class formatted to a String.
      Overrides:
        `toString` in class `Throwable`
      Returns:
        `RatelimitedException{delay=<delay>, botId=<botId>, ip=<ip>, route=<route>}`

    - #### getMessage

          public String getMessage()

      Returns a formatted message displaying the various information returned in this exception.
      This essentially returns the same value as `toString()` does.
      Overrides:
        `getMessage` in class `Throwable`
      Returns:
        Formatted String containing the provided information from the response. Same format as `toString()`.