|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Internet and Network > HTP. - Command > !HTP-General - General HTTP operations and utilities > !Request-Management - Commands for preparing, executing, and inspecting HTTP requests > HTP.GetErrCode |
Retrieves the numeric error code from the last HTP operation. This command is useful for programmatic error handling when you need to check the specific error type rather than the error message text.
HTP.GetErrCode[|$$RET_CODE]
Parameter |
Description |
$$RET_CODE |
Optional variable to store the numeric error code. If omitted, the error code is returned on the stack. |
Code |
Description |
0 |
No error (success) |
1 |
General error |
2 |
Connection failed |
3 |
Timeout |
4 |
Invalid URL |
5 |
Network error |
6 |
HTTP error (check status code) |
HTP.Request|http://example.com/api|$$Result
HTP.GetErrCode|%%ErrCode
IVV.%%ErrCode!0
PRT.Error occurred: %%ErrCode
ELS.
PRT.Request successful
EIF.
HTP.GetErrTxt - Gets the error message text
HTP.GetErr - Gets the last error details
HTP.ClrErr - Clears the error state
HTP.GetErrHist - Gets error history
Previous: HTP.GetErr | Top: HTP Commands | Next: HTP.GetErrTxt