HTP.GetErrCode

<< 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

Intention

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.

 

Syntax

HTP.GetErrCode[|$$RET_CODE]

 

Parameter Explanation

Parameter

Description

$$RET_CODE

Optional variable to store the numeric error code. If omitted, the error code is returned on the stack.

 

Common Error Codes

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)

 

Example

HTP.Request|http://example.com/api|$$Result

HTP.GetErrCode|%%ErrCode

IVV.%%ErrCode!0

 PRT.Error occurred: %%ErrCode

ELS.

 PRT.Request successful

EIF.

 

See Also

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

 

Navigation

Previous: HTP.GetErr | Top: HTP Commands | Next: HTP.GetErrTxt