Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
OCamlPro
www
Commits
a86c9666
Commit
a86c9666
authored
Nov 16, 2021
by
Louis Gesbert
Browse files
Bind 404 error
parent
eb4ed6fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
src/error.ml
src/error.ml
+24
-1
No files found.
src/error.ml
View file @
a86c9666
...
...
@@ -3,7 +3,30 @@ let error_msg code reason = Format.sprintf "<h1>Error: %d - %s</h1>" code reason
let
page
code
reason
=
let
content
=
match
code
with
|
404
->
Format
.
sprintf
{
|%
s
<
br
/>|
}
(
error_msg
code
reason
)
|
404
->
{
html
|
<
style
type
=
"text/css"
>
body
{
background
-
color
:
black
;
}
br
,
hr
{
display
:
none
;
}
h1
{
color
:
rgba
(
255
,
255
,
255
,.
75
);
margin
:
1
.
5
ex
;
text
-
align
:
center
;
}
footer
{
position
:
fixed
;
bottom
:
0
;
left
:
0
;
right
:
0
;
text
-
align
:
center
;
}
</
style
>
<
h1
>
Error
404
</
h1
>
<
script
src
=
"/assets/js/404.js"
></
script
>
|
html
}
|
n
->
error_msg
n
reason
in
content
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