openrat-java-client

Unnamed repository; edit this file 'description' to name the repository.
git clone http://git.code.weiherhei.de/openrat-java-client.git
Log | Files | Refs

ServerSideException.java (658B)


      1 package de.openrat.client.util;
      2 
      3 public class ServerSideException extends Exception {
      4 
      5     private String name;
      6 
      7     public ServerSideException() {
      8 
      9     }
     10 
     11     public ServerSideException(String message, String name) {
     12         super(message);
     13         this.name = name;
     14     }
     15 
     16 
     17     public ServerSideException(String message) {
     18         super(message);
     19     }
     20 
     21 
     22     public String toString() {
     23         // if name is set, use it and not the class name.
     24         String s = (name != null) ? name : getClass().getName();
     25 
     26         String message = getLocalizedMessage();
     27         return (message != null) ? (s + ": " + message) : s;
     28     }
     29 }