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) {
super(cause);
}
}

View File

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

View File

@ -6,20 +6,19 @@ package de.danoeh.antennapod.core.storage;
*/
public class DownloadRequestException extends Exception {
public DownloadRequestException() {
super();
}
public DownloadRequestException() {
super();
}
public DownloadRequestException(String detailMessage, Throwable throwable) {
super(detailMessage, throwable);
}
public DownloadRequestException(String message, Throwable cause) {
super(message, cause);
}
public DownloadRequestException(String detailMessage) {
super(detailMessage);
}
public DownloadRequestException(Throwable throwable) {
super(throwable);
}
public DownloadRequestException(String message) {
super(message);
}
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;
public class UnsupportedFeedtypeException extends Exception {
private static final long serialVersionUID = 9105878964928170669L;
private final TypeGetter.Type type;
private String rootElement;
private String message = null;
public UnsupportedFeedtypeException(Type type) {
super();
this.type = type;
}
private static final long serialVersionUID = 9105878964928170669L;
private final TypeGetter.Type type;
private String rootElement;
private String message = null;
public UnsupportedFeedtypeException(Type type) {
super();
this.type = type;
}
public UnsupportedFeedtypeException(Type type, String rootElement) {
this.type = type;
this.rootElement = rootElement;
}
public UnsupportedFeedtypeException(String message) {
this.message = message;
type = Type.INVALID;
}
public UnsupportedFeedtypeException(String message) {
this.message = message;
type = Type.INVALID;
}
public TypeGetter.Type getType() {
return type;
}
return type;
}
public String getRootElement() {
return rootElement;
}
@Override
public String getMessage() {
if (message != null) {
return message;
} else if (type == TypeGetter.Type.INVALID) {
return "Invalid type";
} else {
return "Type " + type + " not supported";
}
}
public String getMessage() {
if (message != null) {
return message;
} else if (type == TypeGetter.Type.INVALID) {
return "Invalid type";
} else {
return "Type " + type + " not supported";
}
}
}

View File

@ -1,21 +1,22 @@
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 InvalidFeedException() {
}
public InvalidFeedException() {
}
public InvalidFeedException(String detailMessage) {
super(detailMessage);
}
public InvalidFeedException(String message) {
super(message);
}
public InvalidFeedException(Throwable throwable) {
super(throwable);
}
public InvalidFeedException(String detailMessage, Throwable throwable) {
super(detailMessage, throwable);
}
public InvalidFeedException(Throwable cause) {
super(cause);
}
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;
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) {
super(msg);
this.media = media;
}
public MediaFileNotFoundException(String msg, FeedMedia media) {
super(msg);
this.media = media;
}
public FeedMedia getMedia() {
return media;
}
public FeedMedia getMedia() {
return media;
}
}

View File

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

View File

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