Show TOC

Handling Exceptions in the Code Coverage APILocate this document in the navigation structure

Procedure

The methods of the Coverage API raise two exceptions:

  • CX_SCV_EXECUTION_ERROR for unexpected errors during operation.

  • CX_SCV_CALL_ERROR for illegal method calls in programs that use the Coverage API.

Below is sample code showing the exceptions. The sample program for single measurements and the code examples in the Measurement Series tutorial show some typical situations in the handling of these exceptions.

DATA: execution_error TYPE REF TO cx_scv_execution_error,
      call_error      TYPE REF TO cx_scv_call_error.

TRY.
    "execute measurement and get result
  CATCH cx_scv_execution_error INTO execution_error.
    "use execution_error->get_text( ) to log error
  CATCH cx_scv_call_error INTO call_error.
    "issue an error message'
ENDTRY.