abap2UI5/src/00/z2ui5_cx_fw_error.clas.abap
oblomov b38a9af146
new binding (#503)
* update

* new binding

* update

* new binding

* abaplint

* updates

* update binding

* Update abaplint.jsonc

* Update abaplint.jsonc

* update

* Update abaplint.jsonc

* Update abaplint.jsonc

* Update abaplint.jsonc

* update

* update binding

* abaplint fixes

* abaplint fixes

* added unit tests

* abaplint fixes

* added unit tests

* Update abaplint.jsonc

* more unit tests

* more unit tests

* Update src/00/z2ui5_cl_fw_utility.clas.abap

Co-authored-by: Lars Hvam <larshp@hotmail.com>

* Update src/00/z2ui5_cl_fw_utility.clas.abap

Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>

* update unit tests

* update

* refactoring binding main

* abaplint fixes

* exception renamind and bind_local

* Delete z2ui5_cl_fw_error.clas.abap

* Delete z2ui5_cl_fw_handler.clas.testclasses.abap

* Delete z2ui5_cl_fw_error.clas.xml

* update refactoring

* refactoring binding

* update

* update binding

* refactoring and unit tests

* abaplint fixes

* unit test cx_fw_error

* abaplint fixes

* abaplint fixes

* refactoring

* Update abaplint.jsonc

* update

* updates

* refactoring and more unit tests

* abaplint fixes

* downport readiness

* downport readiness

* unit test one time binding

* update versions

* refactor bind method

* update unit test order

* unit test order

* unit test order

* unit test order

* unit test order

* unit test order

* unit test order

* update version

* fix one way binding

* refactoring json to any

* bugfix dissolve object ref

* update xml_view->get and unit test naming

* cleanup unit tests

* add check binding with dereferenced data

* nested models fixes

* update xml view with refactored method names

* error handling, exception texts

* fix xml transformation bug

* add more exceptions

* refactoring char to string

* unit test

* unit tests

* unit tests order

* unit test order

* unit test order

* unit test order

* update handling generic data references

* adjust binding, no more auto local binding

* update binding

* abapgit small diffs

* update unit tests

* update unit tests

* update unit tests

* unit tests

* abaplint fixes

---------

Co-authored-by: Lars Hvam <larshp@hotmail.com>
Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
2023-08-27 14:39:52 +02:00

62 lines
1.2 KiB
ABAP

class Z2UI5_CX_FW_ERROR definition
public
inheriting from CX_NO_CHECK
final
create public .
public section.
data:
BEGIN OF ms_error,
x_root TYPE REF TO cx_root,
uuid TYPE string,
text TYPE string,
END OF ms_error .
methods CONSTRUCTOR
importing
!VAL type ANY optional
!PREVIOUS type ref to CX_ROOT optional
preferred parameter VAL .
methods IF_MESSAGE~GET_TEXT
redefinition .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS Z2UI5_CX_FW_ERROR IMPLEMENTATION.
METHOD constructor ##ADT_SUPPRESS_GENERATION.
super->constructor( previous = previous ).
CLEAR textid.
TRY.
ms_error-x_root ?= val.
CATCH cx_root.
ms_error-text = val.
ENDTRY.
ms_error-uuid = z2ui5_cl_fw_utility=>func_get_uuid_32( ).
ENDMETHOD.
METHOD IF_MESSAGE~get_text.
IF ms_error-x_root IS NOT INITIAL.
result = ms_error-x_root->get_text( ).
DATA(error) = abap_true.
ELSEIF ms_error-text IS NOT INITIAL.
result = ms_error-text.
error = abap_true.
ENDIF.
result = COND #( WHEN error = abap_true AND result IS INITIAL THEN `unknown error` else result ).
ENDMETHOD.
ENDCLASS.