if (obj.status == 600) {

  # We arrive here if we need to compose a custom error page
  # at the edge.  We can use a local variable to store the
  # page's HTML source and then create the response from it.

  declare local var.custom_error_page STRING;

  set var.custom_error_page = {"
  <!DOCTYPE html>
  <html lang="en">
  <head>
    <title>There was a problem</title>
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" type="text/css">
    <style>
      body { display: inline-block; background: #7000f9 no-repeat; height: 100vh; margin: 0; color: white; }
      h1 { margin: .8em 3rem; font: 4em Roboto; }
      p { display: inline-block; margin: .2em 3rem; font: 2em Roboto; }
    </style>
  </head>
  <body>
    <h1>"} req.http.restart-for-custom-response {" APOLOGIES!</h1>
    <p>Something went wrong</p>  
  </body>
  </html>
"}; 

  log "We're composing an error page at the edge";
  set obj.http.content-type = "text/html; charset=utf-8";
  synthetic var.custom_error_page;
  return (deliver);
}