acs_bootstrap_fatal_error (private)

 acs_bootstrap_fatal_error message [ throw_error_p ]

Defined in packages/acs-tcl/tcl/bootstrap-doc-procs.tcl

Record and log a fatal bootstrap error and install filters that display a service-unavailable response in place of the request processor.

Parameters:
message (required)
Error message to record.
throw_error_p (optional, defaults to "1")
Whether to raise a bootstrap_fatal_error Tcl error after installing the failure filters.

Partial Call Graph (max 5 caller/called nodes):
packages/acs-bootstrap-installer/bootstrap.tcl packages/acs-bootstrap-installer/ bootstrap.tcl acs_bootstrap_fatal_error acs_bootstrap_fatal_error packages/acs-bootstrap-installer/bootstrap.tcl->acs_bootstrap_fatal_error

Testcases:
No testcase defined.
Source code:
    # First of all, redefine the "rp_invoke_filter" and "rp_invoke_procs"
    # routines to do nothing, to circumvent the request processor.
    proc rp_invoke_filter { conn arg why } { return "filter_ok" }
    proc rp_invoke_procs { conn arg why } {}
    set proc_name {Bootstrap}

    # Save the error message.
    nsv_set bootstrap_fatal_error . "$message<blockquote><pre>[ns_quotehtml $::errorInfo]</pre></blockquote>"
    # Log the error message.
    ns_log Error "$proc_name: Server startup failed: $message\n$::errorInfo"

    # Define a filter procedure which displays the appropriate error message.
    proc bootstrap_write_error { args } {
        ns_returnerror 503 "Server startup failed: [nsv_get bootstrap_fatal_error .]"
        return "filter_return"
    }

    # Register the filter on GET/POST/HEAD * to return this message.
    ns_register_filter preauth GET * bootstrap_write_error
    ns_register_filter preauth POST * bootstrap_write_error
    ns_register_filter preauth HEAD * bootstrap_write_error

    if { $throw_error_p } {
        return -code error -errorcode bootstrap_fatal_error "Bootstrap fatal error"
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: