1
2
3
4
5
6 package org.astrogrid.dataservice.metadata;
7
8 import java.io.IOException;
9
10
11 /***
12 * An exception for when things go wrong generating metadata
13 * <p>
14 * The original exception should wherever possible be preserved as the cause
15 *
16 * @author M Hill
17 */
18
19 public class MetadataException extends IOException
20 {
21 /***
22 * Constructor taking the cause of the error (an exception/error) and
23 * a message describing the context
24 */
25 public MetadataException(String message, Throwable cause)
26 {
27 super(message);
28 initCause(cause);
29 }
30
31 /***
32 * Convenience constructor that just takes the cause of the error
33 */
34 public MetadataException(Throwable cause)
35 {
36 super("");
37 initCause(cause);
38 }
39
40 /***
41 * THis constructor should NOT be used when catching & rethrowing
42 * exceptions - in such cases use a constructor which takes a throwable, to
43 * preserve the original information
44 */
45 public MetadataException(String message)
46 {
47 super(message);
48 }
49
50 }
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66