!--a11y-->
Error Handling Using the ICM 
If the ICM determines an error, in most cases it returns a static text to the browser:

You can also configure the ICM so that it returns dynamic error pages. The following section describes how you do this.
The ICM recognizes the following errors.
|
Error Name |
Meaning |
|
The SAP Web AS is out of memory to process the request |
|
|
ETIMEOUT |
The SAP Web AS did not return a response within a specified period of time |
|
ENOTAVAIL |
A resource (file, service) is not available |
|
ENOSESSION |
The session for the session cookie no longer exists |
|
ENOSSLREQ |
SSL is expected on this port, no plaintext |
|
EOVERLOAD |
The SAP Web AS is overloaded and cannot accept any more requests |
|
EPERM |
Access is refused (for example, at the SAP Web dispatcher) |
|
EPROTERROR |
HTTP protocol error (incorrect syntax, missing header fields,...) |
|
EINTERN |
ICM internal error (unspecific) |
For each of these errors, an HTML page can be created which is sent to the client when the error occurs. You can define both static pages (ending .html) and dynamic pages (ending .shtml).
Moreover, you can create a file ICMERR-EDEFAULT.{html,shtml} in directory icm/HTTP/error_templ_path, whose contents are returned if there is no other template for the error.
If external
resources (such as images) should be referenced in the error templates, these
can be delivered with the ICM’s file access handler. See
also
icm/HTTP/file_access_<xx>.
To use the ICM’s dynamic error handling, you must set the profile parameter icm/HTTP/error_templ_path to the directory with the error template files: For example:
icm/HTTP/error_templ_path = /usr/sap/B6M/D13/data/icmerror
If a static error page is defined for an error (ending .html), this is returned to the client.
The dynamic pages support the following SSI commands (server-die includes, see http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html).

For the dynamic substitutions, the whole file must be searched for the SSI tags "<!--". The effort required to do this is related to the size of the file. The dynamic pages cannot be stored in the cache either.
The following section explains the SSI commands that are supported.
<!--#echo var="variable" -->
You can set the following variables:
|
Variable Name |
Meaning |
|
DATE_LOCAL |
Current time/date: Tue Mar 26 17:15:32 2002 |
|
DATE_GMT
|
Current GMT time/date: Tue Mar 26 17:15:32 2002 |
|
LAST_MODIFIED |
The time when the current file was last modified |
|
FILE_SIZE |
Size of the current file in Bytes |
|
SERVER_SOFTWARE |
SAP Web Application Server 6.30 |
|
SERVER_NAME |
The name of the server |
|
SERVER_PORT |
The server port |
|
PATH_TRANSLATED |
URL path (without parameters) |
|
ICM_SERVER |
Host name and port through which this server can be reached. For example: Is3022.wdf.sap-ag.de:1080 |
|
ICM_INSTANCE |
Instance name: ls3022_BIN_12 |
|
ICM_ERR_CODE |
Error that occurred (numeric) |
|
ICM_ERR_VERSION |
ICM version |
|
ICM_ERR_COMPONENT |
Component |
|
ICM_ERR_MODULE |
Module name |
|
ICM_ERR_LINE |
Line |
|
ICM_ERR_DETAIL |
Detail on the error that occurred |

Not all fields are available for all errors.
With error ICMEOVERLOAD, for example, the request has not yet been read, which is why field PATH_TRANSLATED has not been set.

In your page you can write, for example:
<tr><td>Server:</td><td><!--#echo var="ICM_SERVER" --></td></tr>
</tr><tr><td background="http://<!--#echo var="ICM_SERVER" ‑‑>/images/graybar_tile.jpg" height="31">
You can use this command to include a different file at this point.
<!--#include file="file name" -->

Your error page can be framed, for example, by the two INCLUDE statements:
<!--#include file="header.html" -->
...
<!--#include file="footer.html" -->

The file must not include itself! Recursive inclusion causes the ICM to terminate.

You can find an example of a dynamic error page and the .shtml file in Examples of a Dynamic Error Page.
If parameter icm/HTTP/error_templ_path is not set, the ICM static error page is always returned.
If parameter is set, when error <ERRNAME> occurs, the ICM first checks whether file ICMERR‑<ERRNAME>.html is located in the directory specified by icm/HTTP/error_templ_path, and sends it to the client. If it cannot find this file, it searches for ICMERR<ERRNAME>.shtml and returns it.
In no specific error page can be found, the ICM returns the default error page ICMERR-EDEFAULT.{html,shtml}(see above). If this file also does not exist, the static page is returned.
For reasons of
performance, the ICM checks once the error templates that are available. This
is why you must restart the ICM if you add new templates (changes to the
templates are recognized). You
can use the ICM Monitor to restart it (Transaction SMICM) (see
Monitoring the ICM
Using the ICM Monitor).
