Catch exceptions of ei_client->receive to avoid dump

This commit is contained in:
Gregor Wolf 2014-07-20 10:54:30 +02:00
parent 80a9740b7c
commit e23e93fc74

View File

@ -4754,8 +4754,8 @@ CLASS lcl_transport IMPLEMENTATION.
DATA: lv_hash TYPE c LENGTH 40,
lv_len TYPE i,
lt_result TYPE TABLE OF string,
lv_data TYPE string.
lv_data TYPE string,
lv_text TYPE string.
cl_http_client=>create_by_url(
EXPORTING
@ -4771,7 +4771,28 @@ CLASS lcl_transport IMPLEMENTATION.
name = '~request_uri'
value = lcl_url=>path_name( is_repo-url ) && '.git/info/refs?service=git-' && iv_service && '-pack' ).
ei_client->send( ).
ei_client->receive( ).
ei_client->receive(
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3
OTHERS = 4
).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
lv_text = 'HTTP Communication Failure'.
WHEN 2.
lv_text = 'HTTP Invalid State'.
WHEN 3.
lv_text = 'HTTP Processing failed'.
WHEN OTHERS.
lv_text = 'Another error occured'.
ENDCASE.
RAISE EXCEPTION TYPE lcx_exception
EXPORTING
iv_text = lv_text.
ENDIF.
check_http_200( ei_client ).