abaplint / abaplint-sci-client

ABAP part for running abaplint on ABAP backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No error if abaplint instance not available

BlackmanCC opened this issue · comments

abaplint-sci-client does not receive an error if the abaplint instance is not available (e.g. docker container not running).

ZCL_ABAPLINT_BACKEND_API_AGENTCP->PARSE_RESPONSE gets lv_code "502" and lv_sreason "Bad Gateway" and runs into
zcx_abapgit_ajson_error with message "JSON PARSER: Node without name (maybe not JSON) @ /"

The exception is caught in ZCL_ABAPLINT_CHECK->GET_MAP, but not handled.

I think the code in ZCL_ABAPLINT_BACKEND_API_AGENT->PARSE_RESPONSE should be changed like this:
before:

    IF lv_response IS INITIAL.
      RAISE EXCEPTION TYPE zcx_abaplint_error
        EXPORTING
          message = |API request failed [{ lv_scode }]|.
    ENDIF.

after:

    IF lv_scode <> IF_HTTP_STATUS=>REASON_200.
      RAISE EXCEPTION TYPE zcx_abaplint_error
        EXPORTING
          message = |API request failed [{ lv_scode }]|.
    ENDIF.