File tree 2 files changed +27
-2
lines changed
2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,31 @@ object App {
117
117
val anView = new AnView
118
118
render.view(anView).toFuture
119
119
}
120
+
121
+
122
+ /**
123
+ * Custom Error Handling
124
+ *
125
+ * curl http://localhost:7070/error
126
+ */
127
+ get(" /error" ) { request =>
128
+ 1234 / 0
129
+ render.plain(" we never make it here" ).toFuture
130
+ }
131
+
132
+ error { request =>
133
+ render.status(500 ).plain(" whoops!" ).toFuture
134
+ }
135
+
136
+
137
+ /**
138
+ * Custom 404s
139
+ *
140
+ * curl http://localhost:7070/notfound
141
+ */
142
+ notFound { request =>
143
+ render.status(404 ).plain(" not found yo" ).toFuture
144
+ }
120
145
}
121
146
122
147
val app = new ExampleApp
@@ -184,7 +209,7 @@ Add the dependency to your pom.xml
184
209
<dependency >
185
210
<groupId >com.twitter</groupId >
186
211
<artifactId >finatra</artifactId >
187
- <version >1.0.3 </version >
212
+ <version >1.1.0 </version >
188
213
</dependency >
189
214
```
190
215
Original file line number Diff line number Diff line change 1
- VERSION=1.0.3
1
+ VERSION=1.1.0
2
2
EXAMPLE_REPO=~ /personal/finatra_example
3
3
4
4
You can’t perform that action at this time.
0 commit comments