Skip to content

Commit b9ae333

Browse files
committed
docs: split Messages, Errors into Messages/Errors sub-pages and move Logging in
1 parent 09f6bf0 commit b9ae333

4 files changed

Lines changed: 53 additions & 39 deletions

File tree

docs/.vitepress/config.mjs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,15 @@ export default defineConfig({
150150
},
151151
],
152152
},
153-
{ text: "Messages, Errors", link: "/development/messages" },
153+
{
154+
text: "Messages, Errors",
155+
collapsed: true,
156+
items: [
157+
{ text: "Messages", link: "/development/messages/messages" },
158+
{ text: "Errors", link: "/development/messages/errors" },
159+
{ text: "Logging", link: "/development/messages/logging" },
160+
],
161+
},
154162
{ text: "Translation, i18n", link: "/development/translation" },
155163
{ text: "Popups, Popovers", link: "/development/popups" },
156164
{
@@ -197,7 +205,6 @@ export default defineConfig({
197205
text: "Misc Topics",
198206
collapsed: true,
199207
items: [
200-
{ text: "Logging", link: "/development/specific/logging" },
201208
{ text: "XLSX", link: "/development/specific/xlsx" },
202209
{ text: "Locks", link: "/development/specific/locks" },
203210
{ text: "Statefulness", link: "/development/specific/statefulness" },
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
outline: [2, 4]
3+
---
4+
# Errors
5+
6+
Beyond plain messages, abap2UI5 ships dedicated popups and fallbacks for handling exceptions and unexpected failures.
7+
8+
#### Error Popup
9+
To display full details of your exception:
10+
```abap
11+
METHOD z2ui5_if_app~main.
12+
13+
TRY.
14+
DATA(lv_val) = 1 / 0.
15+
CATCH cx_root INTO DATA(lx).
16+
client->nav_app_call( z2ui5_cl_pop_error=>factory( lx ) ).
17+
ENDTRY.
18+
19+
ENDMETHOD.
20+
```
21+
22+
#### Uncaught Errors
23+
When your code doesn't catch exceptions, the framework catches them and displays the standard error popup. Try this:
24+
25+
```abap
26+
METHOD z2ui5_if_app~main.
27+
28+
RAISE EXCEPTION NEW cx_sy_itab_line_not_found( ).
29+
30+
ENDMETHOD.
31+
```
32+
33+
#### Uncatchable Exceptions / Short Dumps
34+
What happens if your code raises uncatchable exceptions? The default HTTP handler exception output appears. Processing halts, and the user has to reload the browser. Reserve this for unexpected cases:
35+
36+
```abap
37+
METHOD z2ui5_if_app~main.
38+
39+
ASSERT 1 = `This is an error message!`.
40+
41+
ENDMETHOD.
42+
```
Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
outline: [2, 5]
33
---
4-
# Messages, Errors
4+
# Messages
55

6-
Showing messages and errors is an everyday task for ABAP developers. The functions below cover the most common cases.
6+
Showing messages is an everyday task for ABAP developers. The functions below cover the most common cases.
77

88
#### Message Toast
99

@@ -86,41 +86,6 @@ METHOD z2ui5_if_app~main.
8686
8787
client->nav_app_call( z2ui5_cl_pop_messages=>factory( lt_msg ) ).
8888
89-
ENDMETHOD.
90-
```
91-
#### Error Popup
92-
To display full details of your exception:
93-
```abap
94-
METHOD z2ui5_if_app~main.
95-
96-
TRY.
97-
DATA(lv_val) = 1 / 0.
98-
CATCH cx_root INTO DATA(lx).
99-
client->nav_app_call( z2ui5_cl_pop_error=>factory( lx ) ).
100-
ENDTRY.
101-
102-
ENDMETHOD.
103-
```
104-
105-
#### Uncaught Errors
106-
When your code doesn't catch exceptions, the framework catches them and displays the standard error popup. Try this:
107-
108-
```abap
109-
METHOD z2ui5_if_app~main.
110-
111-
RAISE EXCEPTION NEW cx_sy_itab_line_not_found( ).
112-
113-
ENDMETHOD.
114-
```
115-
116-
#### Uncatchable Exceptions / Short Dumps
117-
What happens if your code raises uncatchable exceptions? The default HTTP handler exception output appears. Processing halts, and the user has to reload the browser. Reserve this for unexpected cases:
118-
119-
```abap
120-
METHOD z2ui5_if_app~main.
121-
122-
ASSERT 1 = `This is an error message!`.
123-
12489
ENDMETHOD.
12590
```
12691

0 commit comments

Comments
 (0)