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 * A header value with an unclosed single quote. Thrown when the library does
36 * not have automatic header repairs enabled at present.
37 *
38 * @author Attila Kovacs
39 * @see FitsFactory#setAllowHeaderRepairs(boolean)
40 * @since 1.16
41 */
42 public class UnclosedQuoteException extends HeaderCardException {
43
44 /**
45 *
46 */
47 private static final long serialVersionUID = 1292006588668191639L;
48
49 private static String getMessage(String line) {
50 return "Unclosed quotes in: [" + line.trim() + "]" + "\n\n --> Try FitsFactory.setAllowHeaderRepairs(true).\n";
51 }
52
53 /**
54 * Instantiates a new exception indicated an unclosed string quote in a
55 * parsed header value.
56 *
57 * @param line
58 * the 80-character header record fro which the exception
59 * occurred.
60 */
61 public UnclosedQuoteException(String line) {
62 super(getMessage(line));
63 }
64
65 }