Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
roguestar
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christopher Lane Hinson
roguestar
Commits
4e0be2f5
Commit
4e0be2f5
authored
May 21, 2014
by
Christopher Lane Hinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enhanced error messages.
parent
650a2f21
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
Main.hs
Roguestar/Server/Main.hs
+6
-5
404.mustache
static/templates/404.mustache
+1
-1
No files found.
Roguestar/Server/Main.hs
View file @
4e0be2f5
...
...
@@ -46,14 +46,14 @@ appInit = makeSnaplet "roguestar-server-snaplet" "Roguestar Server" Nothing $
(
"/play"
,
play
),
(
"/static"
,
static
),
(
"/fail404"
,
handle404
),
(
"/fail500"
,
handle500
(
do
error
"
my brain exploded
"
)),
(
"/fail500"
,
handle500
(
do
error
"
this is an error message
"
)),
(
"/feedback"
,
postFeedback
),
(
"/feedback-thanks"
,
staticTemplate
"static/templates/feedback-thanks.mustache"
),
(
"/feedback-thanks"
,
method
GET
$
ifTop
$
staticTemplate
"static/templates/feedback-thanks.mustache"
),
(
"/options"
,
options
),
(
"
"
,
staticTemplate
"static/templates/index.mustache"
)]
(
"
/"
,
method
GET
$
ifTop
$
staticTemplate
"static/templates/index.mustache"
)]
config
<-
liftIO
$
getConfiguration
default_timeout
game
<-
liftIO
$
createGameState
config
wrapSite
(
<|>
handle404
)
wrapSite
(
\
site
->
site
<|>
handle404
)
wrapSite
handle500
return
$
App
game
the_globals
...
...
@@ -72,6 +72,7 @@ handle500 m = (m >> return ()) `CatchIO.catch` \(e::SomeException) -> do
writeText
"<html><head><title>oh noes</title></head>"
writeText
"<body style=
\"
background:black; color:white;
\"
><h1>theirs a porblem</h1>"
writeText
"<p>i'm so sorry the website broke a little</p>"
writeText
"<p>maybe you should file a <a href=
\"
/options#feedback
\"
>complaint</a></p>"
writeText
"<img src=
\"
static/art/TabularMonstrosity.svg
\"
/>"
writeText
"<pre>
\n
"
writeLazyText
$
htmlEscape
t
...
...
@@ -96,7 +97,7 @@ static :: Handler App App ()
static
=
serveDirectoryWith
static_directory_config
"./static/"
staticTemplate
::
FilePath
->
Handler
App
App
()
staticTemplate
filepath
=
method
GET
$
ifTop
$
staticTemplate
filepath
=
do
globals
<-
getBasicState
renderThemedPage
filepath
$
object
[
"static"
.=
True
,
...
...
static/templates/404.mustache
View file @
4e0be2f5
...
...
@@ -3,7 +3,7 @@
<div
id=
"documenttext"
class=
"roguebox"
>
<h1>
404 Not Found
</h1>
<p>
You
has a sad roguestar :(
</p>
<p>
You
r web browser asked for a thing, but it wasn't here. Maybe you should
<a
href=
"/options#feedback"
>
complain
</a>
?
</p>
</div>
{{>
footer
}}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment