1 /*
2 * #%L
3 * nom.tam FITS library
4 * %%
5 * Copyright (C) 2004 - 2024 nom-tam-fits
6 * %%
7 * This is free and unencumbered software released into the public domain.
8 *
9 * Anyone is free to copy, modify, publish, use, compile, sell, or
10 * distribute this software, either in source code form or as a compiled
11 * binary, for any purpose, commercial or non-commercial, and by any
12 * means.
13 *
14 * In jurisdictions that recognize copyright laws, the author or authors
15 * of this software dedicate any and all copyright interest in the
16 * software to the public domain. We make this dedication for the benefit
17 * of the public at large and to the detriment of our heirs and
18 * successors. We intend this dedication to be an overt act of
19 * relinquishment in perpetuity of all present and future rights to this
20 * software under copyright law.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28 * OTHER DEALINGS IN THE SOFTWARE.
29 * #L%
30 */
31
32 package nom.tam.fits;
33
34 /**
35 * The keyword is a HIERARCH-style long FITS keyword but the library does not
36 * have the hierarch support enabled at present.
37 *
38 * @author Attila Kovacs
39 * @see FitsFactory#setUseHierarch(boolean)
40 * @since 1.16
41 */
42 public class HierarchNotEnabledException extends HeaderCardException {
43
44 /**
45 *
46 */
47 private static final long serialVersionUID = 3178787676158092095L;
48
49 private static String getMessage(String key) {
50 return "Hierarch support is not enabled for [" + key + "]" + "\n\n --> Try FitsFactory.setUseHierarch(true).\n";
51 }
52
53 /**
54 * Instantiates a new exception for a HIERARCH-style header keyword, when
55 * support for the hierarch convention is not enabled.
56 *
57 * @param key
58 * the HIERARCH-style FITS keyword.
59 */
60 public HierarchNotEnabledException(String key) {
61 super(getMessage(key));
62 }
63
64 }