# Copyright for the Uniform Repository Service (c) 1995 - 2020, # by Gerald Banon. All rights reserved. # Version 2.1 # customizeerror.tcl # example of use: # http://gjfb:1905/customizeerror.cgi/404 # ---------------------------------------------------------------------- # CustomizeError proc CustomizeError {} { if [catch { global env global homePath ;# used in FindLanguage global URLibServiceRepository set col ../../../../.. set URLibServiceRepository $env(URLIB_SERVICE_REP) source ../$col/$URLibServiceRepository/doc/utilities1.tcl source ../$col/$URLibServiceRepository/doc/cgi/mirrorfind-.tcl # homePath (used in FindLanguage) set homePath $env(DOCUMENT_ROOT) # pathInfo set pathInfo [file split $env(PATH_INFO)] # errorNumber set errorNumber [lindex $pathInfo end] # language foreach {language languageRep1} [FindLanguage $env(LOBIMIREP)] {break} # localSite set localSite $env(SERVER_NAME):$env(SERVER_PORT) puts {Content-Type: text/html} puts {} switch $language { en { puts " Warning

Warning

" switch $errorNumber { 401 { puts "

Authorization required.

" } 403 { puts "

Forbidden access to the file.

" } 404 { puts "

Requested file not found.

" } } puts "


" } pt-BR { puts " Alerta

Alerta

" switch $errorNumber { 401 { puts "

Autorização requerida.

" } 403 { puts "

Acesso proibido ao arquivo.

" } 404 { puts "

Arquivo requerido não encontrado.

" } } puts "


" } } } m] {puts
$m
; if 0 {global errorInfo; puts
$errorInfo
}} } # CustomizeError - end # ----------------------------------------------------------------------