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

  Class used to indicate when the bot gets Ratelimited by the BotBlock API.
  You can use `getDelay()` to find out how long you have to wait before you can access `the route` again.
  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 ratelimited.
    `int` | `getDelay()` | Returns the delay - in milliseconds - you have to wait to perform a request again.
    `String` | `getIp()` | Returns the ip that was ratelimited.
    `String` | `getMessage()` | Returns a formatted message displaying the various information returned in this exception.
    `String` | `getRoute()` | Returns the route on which the bot was ratelimited.
    `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 ratelimited.
      Returns:
        The id of the bot that was ratelimited

    - #### getIp

          public String getIp()

      Returns the ip that was ratelimited.
      Returns:
        The ip that was ratelimited

    - #### getRoute

          public String getRoute()

      Returns the route on which the bot was ratelimited.
      Returns:
        The route on which the bot was ratelimited

    - #### 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 calls `toString()` in this class.
      Overrides:
        `getMessage` in class `Throwable`
      Returns:
        Same output as `toString()`