forked from kingekinge/spark-submit-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Global.scala
executable file
·43 lines (35 loc) · 871 Bytes
/
Global.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import play.api._
import play.api.mvc._
import play.api.mvc.Results._
import scala.concurrent.Future
import play.api.Play.current
import com.google.inject._
import models._
object Global extends GlobalSettings {
private lazy val injector = {
Play.isProd match {
case _ => {
Guice.createInjector(new Depend)
}
}
}
// 500 - internal server error
override def onError(request: RequestHeader,ex: Throwable) = {
Future.successful(
InternalServerError(
views.html.errors.fzf()
)
)
}
// 404 - page not found error
override def onHandlerNotFound(request: RequestHeader)= {
Future.successful(
NotFound(
views.html.errors.fzf()
)
)
}
override def getControllerInstance[A](clazz: Class[A]) = {
injector.getInstance(clazz)
}
}