Skip to content

Commit

Permalink
fix(objectionary#2681): changed AttributeNotFoundException
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanich96 committed Dec 13, 2023
1 parent 7d31410 commit ccf30b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@

/**
* If the attributes were not found in the Tojo.
* @since 1.0
* @since 0.35.0
*/
public class AttributeNotFoundException extends RuntimeException {

/**
* Ctor.
* @param message The detail message.
* @param attribute The attribute of Tojo.
*/
AttributeNotFoundException(final String message) {
super(message);
AttributeNotFoundException(final ForeignTojos.Attribute attribute) {
super(
String.format(
"There is no '%s' attribute in the tojo", attribute
)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,7 @@ public int hashCode() {
private String attribute(final ForeignTojos.Attribute attribute) {
final String attr = this.delegate.get(attribute.key());
if (attr == null) {
throw new AttributeNotFoundException(
String.format(
"There is no '%s' attribute in the tojo", attribute
)
);
throw new AttributeNotFoundException(attribute);
}
return attr;
}
Expand Down

0 comments on commit ccf30b9

Please sign in to comment.