I probably could. The one thing is that something like this in PHP could do this:
```
function displayError(msg)
{
  echo msg;
  include_once("footer.php");
  exit();
}
```
While with flask this is a little different, so I'm not sure how useful that would actually be.