Skip to content

Commit

Permalink
Added error handling if invalid request method for route was found in…
Browse files Browse the repository at this point in the history
… config
  • Loading branch information
TomasLongo committed Jan 14, 2015
1 parent 0b75446 commit 7b2bd60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/java/de/tlongo/roscoe/core/Roscoe.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ private void go() {
post(route.getRouteUrl(), route);
} else if (route.getMethod().equals("PUT")) {
put(route.getRouteUrl(), route);
} if (route.getMethod().equals("DELETE")) {
} else if (route.getMethod().equals("DELETE")) {
delete(route.getRouteUrl(), route);
} else {
logger.error("Could not create route for unknown request method '{}'", route.getMethod());
throw new RuntimeException("Error creating routes");
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion views/helloworld.html.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>AverageJoe</title>
<title>Roscoe</title>

<!-- Bootstrap -->
<link href="http://{{url}}/assets/twitter-bootstrap/css/bootstrap.min.css" rel="stylesheet">
Expand Down

0 comments on commit 7b2bd60

Please sign in to comment.