javaandroidexceptionbugsense

Throw exception when server is not available


I am working with the bugsense SDK and want to be aware if my API backend goes down. Exception information is obligatory. I have searched the Java Exception library for exceptions related to server availability but could not find any.

Are there any Exceptions from Java or Android related to this? If not would it be advisable to create my own Exception class?


Solution

  • You can create your own. You can extend Exception class. Something like:

    class YourException extends Exception
    {
    }