// Copyright © 2015-2017 Esko Luontola
// This software is released under the Apache License 2.0.
// The license text is at http://www.apache.org/licenses/LICENSE-2.0

/* @flow */

import React from "react";
import {Layout} from "./Layout";
import type {ErrorMessage} from "../router";

let ErrorPage = ({error}: { error: ErrorMessage }) => (
  <Layout>
    <h1>Error {error.status}: {error.message}</h1>
  </Layout>
);

export {ErrorPage};

@@ -280,16 +280,195 @@
 uter%22;%0A%0A
+function formatErrorMessage(error) %7B%0A  let message = 'Error';%0A  if (error.status) %7B%0A    message += ' ' + error.status;%0A  %7D%0A  message += ': ' + error.message;%0A  return message;%0A%7D%0A%0A
 let Erro
@@ -538,44 +538,34 @@
 %3Ch1%3E
-Error %7Berror.status%7D: %7Be
+%7BformatE
 rror
-.m
+M
 essage
+(error)
 %7D%3C/h

fix formatting in case error status in missing