FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
frontend/preview/app/PreviewErrorHandler.scala at test · devhttps/frontend · GitHub
devhttps
/
frontend
Public
forked from
guardian/frontend
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
frontend
/
preview
/
app
/
PreviewErrorHandler.scala
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (23 loc) · 834 Bytes
Breadcrumbs
frontend
/
preview
/
app
/
PreviewErrorHandler.scala
Copy path
File metadata and controls
27 lines (23 loc) · 834 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
com
.
gu
.
contentapi
.
client
.
GuardianContentApiError
import
play
.
api
.
_
import
play
.
api
.
http
.
DefaultHttpErrorHandler
import
play
.
api
.
mvc
.
Results
.
_
import
play
.
api
.
mvc
.
_
import
play
.
api
.
routing
.
Router
import
play
.
core
.
SourceMapper
import
scala
.
concurrent
.
_
class
PreviewErrorHandler
(
env
:
Environment
,
config
:
Configuration
,
sourceMapper
:
Option
[
SourceMapper
],
router
:
=>
Router
)
extends
DefaultHttpErrorHandler
(env, config, sourceMapper,
Some
(router)) {
override
def
onServerError
(
request
:
RequestHeader
,
exception
:
Throwable
)
:
Future
[
Result
]
=
{
exception
match
{
case
GuardianContentApiError
(statusCode, statusMessage, _)
if
statusCode
==
404
=>
Future
.successful(
NotFound
(views.html.not_found(request.path)))
case
_
=>
super
.onServerError(request, exception)
}
}
}
Back
|
FazBrowse Home
|
New Git URL