Reformat exceptions

This also makes the variable and attribute names consistent with the
standard `Exception` class.
This commit is contained in:
Anderson Mesquita 2019-07-21 23:26:47 -04:00
parent 012ed2e8f2
commit f484b7965c
8 changed files with 83 additions and 93 deletions

View File

@ -17,5 +17,4 @@ public class GpodnetServiceAuthenticationException extends GpodnetServiceExcepti
public GpodnetServiceAuthenticationException(Throwable cause) { public GpodnetServiceAuthenticationException(Throwable cause) {
super(cause); super(cause);
} }
} }

View File

@ -7,6 +7,4 @@ class GpodnetServiceBadStatusCodeException extends GpodnetServiceException {
super(message); super(message);
this.statusCode = statusCode; this.statusCode = statusCode;
} }
} }

View File

@ -6,20 +6,19 @@ package de.danoeh.antennapod.core.storage;
*/ */
public class DownloadRequestException extends Exception { public class DownloadRequestException extends Exception {
public DownloadRequestException() { public DownloadRequestException() {
super(); super();
} }
public DownloadRequestException(String detailMessage, Throwable throwable) { public DownloadRequestException(String message, Throwable cause) {
super(detailMessage, throwable); super(message, cause);
} }
public DownloadRequestException(String detailMessage) { public DownloadRequestException(String message) {
super(detailMessage); super(message);
} }
public DownloadRequestException(Throwable throwable) {
super(throwable);
}
public DownloadRequestException(Throwable cause) {
super(cause);
}
} }

View File

@ -3,44 +3,42 @@ package de.danoeh.antennapod.core.syndication.handler;
import de.danoeh.antennapod.core.syndication.handler.TypeGetter.Type; import de.danoeh.antennapod.core.syndication.handler.TypeGetter.Type;
public class UnsupportedFeedtypeException extends Exception { public class UnsupportedFeedtypeException extends Exception {
private static final long serialVersionUID = 9105878964928170669L; private static final long serialVersionUID = 9105878964928170669L;
private final TypeGetter.Type type; private final TypeGetter.Type type;
private String rootElement; private String rootElement;
private String message = null; private String message = null;
public UnsupportedFeedtypeException(Type type) { public UnsupportedFeedtypeException(Type type) {
super(); super();
this.type = type; this.type = type;
} }
public UnsupportedFeedtypeException(Type type, String rootElement) { public UnsupportedFeedtypeException(Type type, String rootElement) {
this.type = type; this.type = type;
this.rootElement = rootElement; this.rootElement = rootElement;
} }
public UnsupportedFeedtypeException(String message) { public UnsupportedFeedtypeException(String message) {
this.message = message; this.message = message;
type = Type.INVALID; type = Type.INVALID;
} }
public TypeGetter.Type getType() { public TypeGetter.Type getType() {
return type; return type;
} }
public String getRootElement() { public String getRootElement() {
return rootElement; return rootElement;
} }
@Override @Override
public String getMessage() { public String getMessage() {
if (message != null) { if (message != null) {
return message; return message;
} else if (type == TypeGetter.Type.INVALID) { } else if (type == TypeGetter.Type.INVALID) {
return "Invalid type"; return "Invalid type";
} else { } else {
return "Type " + type + " not supported"; return "Type " + type + " not supported";
} }
} }
} }

View File

@ -1,21 +1,22 @@
package de.danoeh.antennapod.core.util; package de.danoeh.antennapod.core.util;
/** Thrown if a feed has invalid attribute values. */ /**
* Thrown if a feed has invalid attribute values.
*/
public class InvalidFeedException extends Exception { public class InvalidFeedException extends Exception {
public InvalidFeedException() { public InvalidFeedException() {
} }
public InvalidFeedException(String detailMessage) { public InvalidFeedException(String message) {
super(detailMessage); super(message);
} }
public InvalidFeedException(Throwable throwable) { public InvalidFeedException(Throwable cause) {
super(throwable); super(cause);
} }
public InvalidFeedException(String detailMessage, Throwable throwable) {
super(detailMessage, throwable);
}
public InvalidFeedException(String message, Throwable cause) {
super(message, cause);
}
} }

View File

@ -3,16 +3,16 @@ package de.danoeh.antennapod.core.util.exception;
import de.danoeh.antennapod.core.feed.FeedMedia; import de.danoeh.antennapod.core.feed.FeedMedia;
public class MediaFileNotFoundException extends Exception { public class MediaFileNotFoundException extends Exception {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private final FeedMedia media; private final FeedMedia media;
public MediaFileNotFoundException(String msg, FeedMedia media) { public MediaFileNotFoundException(String msg, FeedMedia media) {
super(msg); super(msg);
this.media = media; this.media = media;
} }
public FeedMedia getMedia() { public FeedMedia getMedia() {
return media; return media;
} }
} }

View File

@ -2,19 +2,18 @@ package de.danoeh.antennapod.core.util.id3reader;
public class ID3ReaderException extends Exception { public class ID3ReaderException extends Exception {
public ID3ReaderException() { public ID3ReaderException() {
} }
public ID3ReaderException(String arg0) { public ID3ReaderException(String message) {
super(arg0); super(message);
} }
public ID3ReaderException(Throwable arg0) { public ID3ReaderException(Throwable message) {
super(arg0); super(message);
} }
public ID3ReaderException(String arg0, Throwable arg1) {
super(arg0, arg1);
}
public ID3ReaderException(String message, Throwable cause) {
super(message, cause);
}
} }

View File

@ -1,24 +1,20 @@
package de.danoeh.antennapod.core.util.vorbiscommentreader; package de.danoeh.antennapod.core.util.vorbiscommentreader;
public class VorbisCommentReaderException extends Exception { public class VorbisCommentReaderException extends Exception {
public VorbisCommentReaderException() { public VorbisCommentReaderException() {
super(); super();
// TODO Auto-generated constructor stub }
}
public VorbisCommentReaderException(String arg0, Throwable arg1) { public VorbisCommentReaderException(String message, Throwable cause) {
super(arg0, arg1); super(message, cause);
// TODO Auto-generated constructor stub }
}
public VorbisCommentReaderException(String arg0) { public VorbisCommentReaderException(String message) {
super(arg0); super(message);
// TODO Auto-generated constructor stub }
}
public VorbisCommentReaderException(Throwable arg0) {
super(arg0);
// TODO Auto-generated constructor stub
}
public VorbisCommentReaderException(Throwable message) {
super(message);
}
} }