How can I customize the default exception tcp_error?

book

Article ID: 167701

calendar_today

Updated On:

Products

ProxySG Software - SGOS

Issue/Introduction

There are two basic ways to customize the error:

GUI Method

  1. Go to MC > Configuration > Policy > Exception.
  2. From Select Text Editor, select Install Exceptions Definitions, then click Install.
  3. Look for the following line subroutine. Modify the line shown in underlined italic text.

    (exception.tcp_error

    (contact)

    (details "A communication error occurred: $(quot)$(server_connection.socket_errno)$(quot)")

    (format)

    (help "The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.")

    (summary "Network Error")

    (http

    (code "503")

    (contact)

    (details)

    (format)

    (help)

    (summary)

  4. Click Install once done. 


CLI Method

Blue Coat SG300 Series#(config)exceptions

Blue Coat SG300 Series#(config exceptions)edit ?

<exception-id> OR user-defined.<exception-id>

Built-in:

authentication_failed

authentication_failed_password_expired

authentication_log_out

authentication_mode_not_supported

authentication_redirect_from_virtual_host

authentication_redirect_off_box

authentication_redirect_to_virtual_host

authentication_success

authorization_failed

bad_credentials

client_failure_limit_exceeded

coach

configuration_error

connect_method_denied

content_encoding_error

content_filter_denied

content_filter_unavailable

dns_server_failure

dns_unresolved_hostname

dynamic_bypass_reload

gateway_error

icap_communication_error

icap_error

internal_error

invalid_auth_form

invalid_request

invalid_response

invalid_saml_post

license_exceeded

license_expired

method_denied

not_implemented

notify

notify_missing_cookie

password_override

policy_denied

policy_redirect

policy_request_redirect

radius_splash_page

redirected_stored_requests_not_supported

refresh

saml_post

server_authentication_error

server_request_limit_exceeded

silent_denied

ssl_client_cert_expired

ssl_client_cert_ocsp_check_failed

ssl_client_cert_ocsp_status_unknown

ssl_client_cert_revoked

ssl_client_cert_untrusted_issuer

ssl_domain_invalid

ssl_failed

ssl_server_cert_expired

ssl_server_cert_ocsp_check_failed

ssl_server_cert_ocsp_status_unknown

ssl_server_cert_revoked

ssl_server_cert_untrusted_issuer

tcp_error

transformation_error

unsupported_encoding

unsupported_protocol

virus_detected

Blue Coat SG300 Series#(config exceptions)edit tcp_error

Blue Coat SG300 Series#(config exceptions tcp_error)inline ?

Contact    Set the $(exception.contact) substitution  

details    Set the $(exception.details) substitution

format     Set the format for this exception

help       Set the $(exception.help) substitution

http       Configure substitution fields for just HTTP exceptions

summary    Set the $(exception.summary) substitution

Blue Coat SG300 Series#(config exceptions tcp_error)inline help eof This is my custom tcp_error exception.

eof 

ok 

Blue Coat SG300 Series#(config exceptions tcp_error)

The above changed my default exception from:
 

(exception.tcp_error 

(contact)

(details "A communication error occurred: $(quot)$(server_connection.socket_errno)$(quot)") 

(format) 

(help "The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.")

(summary "Network Error")

(http

(code "503")

(contact)

(details)

(format)

(help)

(summary)

To:

(exception.tcp_error

(contact)

(details "A communication error occurred: $(quot)$(server_connection.socket_errno)$(quot)")

(format)

(help <<--219ab438.1d645--

This is my custom tcp_error exception.

--219ab438.1d645--

)

(summary "Network Error")

(http

(code "503")

(contact)

(details)

(format)

(help)

(summary)


Tested and it works:

T400 ~ $ curl -x 10.9.59.220:8080 

http://1.1.1.1

<HTML><HEAD> <TITLE>Network Error</TITLE> </HEAD> <BODY> <FONT face="Helvetica"> <big><strong></strong></big><BR> </FONT> <blockquote> <TABLE border=0 cellPadding=1 width="80%"> <TR><TD> <FONT face="Helvetica"> <big>Network Error (tcp_error)</big> <BR> <BR> </FONT> </TD></TR> <TR><TD> <FONT face="Helvetica"> A communication error occurred: "Operation timed out"

</FONT> 

</TD></TR>

<TR><TD>

<FONT face="Helvetica">


This is my custom tcp_error exception.

</FONT> 

</TD></TR>

<TR><TD>

<FONT face="Helvetica" SIZE=2>

<BR>

For assistance, contact your network support team. 

</FONT>

</TD></TR>

</TABLE>

</blockquote>

</FONT>

</BODY></HTML>


Additional Related Articles

FAQ2856: Custom exception page not showing on websites where destination host is unreachable, tcp_error showing instead. 

FAQ1161: TCP_ERROR 101 - Why do I get this when I use a ProxySG.