ExceptionUtils.java (491B)
1 /** 2 * 3 */ 4 package de.openrat.android.client.util; 5 6 import java.io.IOException; 7 import java.net.SocketTimeoutException; 8 9 import de.openrat.android.client.R; 10 11 /** 12 * @author dankert 13 * 14 */ 15 public class ExceptionUtils 16 { 17 18 public static int getResourceStringId( Throwable throwable) { 19 20 if ( throwable instanceof SocketTimeoutException ) 21 return R.string.error_timeout; 22 else if ( throwable instanceof IOException ) 23 return R.string.error_io; 24 else 25 return R.string.error_io; 26 } 27 }