<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    I have a timing/configuration issue, and any pointers would be
    welcome.<br>
    <br>
    The problem: how to handle configuration/system errors by fallback
    to an error page.<br>
    <br>
    * I am using Catalyst authentication, but sometimes the database
    used for session storage cannot be connected. Under these
    circumstances, I want an error page which can be used to display an
    error suitable for a system administrator<br>
    * The application starts fine, because it does not attempt to
    connect initially<br>
    * When a request starts, the session system fails during the prepare
    stage - calling stuff in Catalyst::Plugin::Session::Store::Delegate,
    and usually get_session_data<br>
    * The application never gets to finalize, so nothing is ever sent to
    the engine - this is the logic in handle_request<br>
    <br>
    Where and how is it best to handle this? <br>
    <br>
    I could do some of this before the first request, and I considered
    hacking which controllers were active since I can do that during the
    setup stage, but this is probably too late, since by then all the
    plugins are set up, and this is where the session management is set.
    <br>
    <br>
    Alternatively, I could do some work during the request cycle, but it
    is not obvious where in the cycle you got to, which makes it hard to
    decide whether you can generate an error. <br>
    <br>
    I could just be missing some documentation: maybe this is covered
    but I haven't been able to find it. <br>
    <br>
    --S<br>
    <div class="moz-signature">-- <br>
      <span style="color: rgb(102, 0, 0);">Stuart Watt<br>
        ARM Product Developer<br>
        Information Balance</span></div>
  </body>
</html>