35 lines
779 B
Plaintext
35 lines
779 B
Plaintext
When multiple, adjacent ``++MONITOR++`` statements have duplicate ``++ON-ERROR++`` blocks, they should be merged to consolidate the ``++ON-ERROR++`` logic for cleaner, more readable code. Note that this applies even when there is intervening code outside any ``++MONITOR++`` block.
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
/free
|
|
monitor;
|
|
// do something...
|
|
on-error;
|
|
CALLP HandleError(*param);
|
|
endmon;
|
|
|
|
// do un-monitored thing
|
|
|
|
monitor;
|
|
// do something else...
|
|
on-error; // Noncompliant
|
|
CALLP HandleError(*param);
|
|
endmon;
|
|
/end-free
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
/free
|
|
monitor;
|
|
// do something...
|
|
// do un-monitored thing
|
|
// do something else...
|
|
on-error;
|
|
CALLP HandleError(*param);
|
|
endmon;
|
|
----
|