error.ml 749 Bytes
Newer Older
Dario Pinto's avatar
Dario Pinto committed
1
let error_msg code reason = Format.sprintf "<h1>Error: %d - %s</h1>" code reason
Dario Pinto's avatar
Dario Pinto committed
2 3 4 5

let page code reason =
  let content =
    match code with
Louis Gesbert's avatar
Louis Gesbert committed
6 7 8 9 10 11 12 13 14 15
    | 404 -> {html|
<style type="text/css">
body {
  background-color: black;
}
br, hr {
  display: none;
}
h1 {
  text-align: center;
16 17 18 19 20 21 22 23 24 25 26 27 28
  position: fixed;
  color: black;
  left: 0;
  right: 0;
  top: 40%;
  z-index: 1;
  font-family: helvetica;
  text-transform: uppercase;
  font-size: 6vmin;
  font-weight: bold;
  mix-blend-mode: overlay;
  user-select: none;
  text-shadow: 0 0 .7vmin black;
Louis Gesbert's avatar
Louis Gesbert committed
29 30 31 32 33 34 35 36 37 38 39 40
}
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}
Dario Pinto's avatar
Dario Pinto committed
41 42 43
    | n -> error_msg n reason
  in
  content