Skip to content

Commit

Permalink
Enhance exception message per #315
Browse files Browse the repository at this point in the history
  • Loading branch information
eepstein committed Jan 19, 2018
1 parent 98c34bb commit cfbea56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ public static Class<?> getType(String type) {
case "bytes32":
return Bytes32.class;
default:
throw new UnsupportedOperationException("Unsupported type encountered");
throw new UnsupportedOperationException("Unsupported type encountered: "
+ type);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private void generate(String destinationDir) throws IOException {

builder = addTypes(builder, typesPackageName);
builder = addGeneratedTypes(builder, autoGeneratedTypesPackageName);
builder = builder.addStatement("default:\nthrow new $T($S + $N)",
builder = builder.addStatement("default:\nthrow new $T($S\n+ $N)",
UnsupportedOperationException.class,
"Unsupported type encountered: ", TYPE);
builder.endControlFlow();
Expand Down

0 comments on commit cfbea56

Please sign in to comment.