Skip to content

Commit

Permalink
Demote FitsException to a runtime exception based on IllegalStateExce…
Browse files Browse the repository at this point in the history
…ption
  • Loading branch information
attipaci committed Dec 13, 2023
1 parent d47b28e commit a46ccda
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/main/java/nom/tam/fits/FitsException.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
*/

/**
* A hard exception for when we cannot deal with some FITS data as expected. In
* retrospect it would have been better to make this a softer runtime exception,
* but this goes back to the beginning of this library so it is here to stay.
* You have no choice but to catch these an deal with them all the time.
* When we cannot deal with some FITS data as expected. Originally it was a hard exception, that you had no choice by to
* catch. Since 1.19, it has been demoted to a softer, runtime exception. This is a back compatible change, which gives
* more freedom to programmers on dealing with these (or not).
*/
public class FitsException extends Exception {
public class FitsException extends IllegalStateException {

/**
*
Expand All @@ -47,24 +46,18 @@ public class FitsException extends Exception {
/**
* Instantiates this exception with the designated message string.
*
* @param msg
* a human readable message that describes what in fact caused
* the exception
* @param msg a human readable message that describes what in fact caused the exception
*/
public FitsException(String msg) {
super(msg);
}

/**
* Instantiates this exception with the designated message string, when it
* was triggered by some other type of exception
* Instantiates this exception with the designated message string, when it was triggered by some other type of
* exception
*
* @param msg
* a human readable message that describes what in fact caused
* the exception
* @param reason
* the original exception (or other throwable) that triggered
* this exception.
* @param msg a human readable message that describes what in fact caused the exception
* @param reason the original exception (or other throwable) that triggered this exception.
*/
public FitsException(String msg, Throwable reason) {
super(msg, reason);
Expand Down

0 comments on commit a46ccda

Please sign in to comment.