title: How to externalize the string for an error message in a custom exception class in Android
body: <p>I have this class</p>
  
  <pre><code>public class InternetConnectionException extends RuntimeException {
  
      int code = 0;
  
      public InternetConnectionException(){
          super("Internet connection is down");
      }
  
      public InternetConnectionException(String message){
          super(message);
      }
  }
  </code></pre>
  
  <p>This error message shouldn't be hardcoded. It should be externalized in order for different languages to be supplied, because when this exception is thrown the message is being displayed on the screen.
  Now, is there a way to externalize it as a <code>strings.xml</code> resource or should I change the design? (i.e. when this exception is thrown, just reference the string resource in the activity and display the resolved value)</p>
  
  <p>I believe that a good design shouldn't allow pure Java classes such as an exception to know about the insides of Android framework, but I could be wrong.</p>