Skip to content

Commit

Permalink
#15 show exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Yegor Bugayenko committed Sep 25, 2016
1 parent bb67c13 commit 3b359c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/io/jare/tk/TkAdd.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ final class TkAdd implements Take {
public Response act(final Request req) throws IOException {
final String name = new RqForm.Base(req).param("name")
.iterator().next().trim();
new SafeUser(this.base.user(new RqUser(req).name())).add(name);
try {
new SafeUser(this.base.user(new RqUser(req).name())).add(name);
} catch (final SafeUser.InvalidNameException ex) {
throw new RsForward(new RsFlash(ex));
}
return new RsForward(
new RsFlash(
String.format(
Expand Down

0 comments on commit 3b359c9

Please sign in to comment.