Change Exeption to Runtime exeption
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
0d2e96b391
commit
43956ff10c
|
@ -12,12 +12,12 @@ public class CategoryName {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CategoryName(final String name) throws IllegalValueObjectArgument {
|
public CategoryName(final String name) {
|
||||||
validateName(name);
|
validateName(name);
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateName(final String name) throws IllegalValueObjectArgument {
|
private void validateName(final String name) {
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
throw new IllegalValueObjectArgument("A Category name can not be null.");
|
throw new IllegalValueObjectArgument("A Category name can not be null.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package exeptions;
|
package exeptions;
|
||||||
|
|
||||||
public class IllegalValueObjectArgument extends Exception {
|
public class IllegalValueObjectArgument extends RuntimeException {
|
||||||
|
|
||||||
public IllegalValueObjectArgument(String message) {
|
public IllegalValueObjectArgument(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
|
|
|
@ -9,7 +9,7 @@ public class LinkUrl {
|
||||||
|
|
||||||
private final URL url;
|
private final URL url;
|
||||||
|
|
||||||
public LinkUrl(String urlString) throws IllegalValueObjectArgument {
|
public LinkUrl(String urlString) {
|
||||||
try {
|
try {
|
||||||
this.url = new URL(urlString);
|
this.url = new URL(urlString);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue