1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.mina.util;
20
21 import java.io.IOException;
22
23 /***
24 * Exception utility.
25 *
26 * @author Trustin Lee (trustin@apache.org)
27 * @version $Rev: 210062 $, $Date: 2005-07-11 12:52:38 +0900 $
28 */
29 public class ExceptionUtil {
30
31 public static void throwException( Throwable t ) throws IOException
32 {
33 if( t instanceof IOException )
34 {
35 throw ( IOException ) t;
36 }
37 else if( t instanceof RuntimeException )
38 {
39 throw ( RuntimeException ) t;
40 }
41 else if( t instanceof Error )
42 {
43 throw ( Error ) t;
44 }
45 else
46 {
47 throw new RuntimeException( t );
48 }
49 }
50
51 private ExceptionUtil()
52 {
53 }
54 }