sdmx-twg / vtl

This repository is used for maintaining the SDMX-VTL specification
11 stars 7 forks source link

Error handling #38

Closed stratosn closed 1 year ago

stratosn commented 7 years ago
reporter issue reference document (UM/RM/EBNF) page line
PL-CSO-20 UM 104 3611
BDI-15 UM 105 All

Issue Description

(PL-CSO-20) An error is identified by the string “VTL-“ followed by a four digit code, where only two digits identifies specific code. This might be not enough for some categories.

(BDI-15) Error handling: the error information shoul be unified, because it allows redundant and non-coherent possibilities, in particular for the ERRORMESSAGE. For some operators ERRORCODE, ERRORLEVEL is mentioned, for other ERRORMESSAGE, ERRORLEVEL.

Proposed Solution

(PL-CSO-20) It should be considered to extend number of digits or extend it to four digits or letters.

(BDI-15) Identify just one output structure for error information. Remove ERRORMESSAGE, the specific properties of the error (message, locale, actions to adopt,…) should be part of an error registry. Otherwise the ErrorMessage need to be multilingual and have many other properties which are not a matters of a language for calculations like VTL.

Discussion in Paris

77-78: error handling

DISCUSSION

--> For both the cases we are going to provide examples of the join between the outcome of the check and the two external tables, one for the ERROR MESSAGES and one of ERRORLEVEL.

--> the problem is not closed.

@dragan-ivanovic's PROPOSAL:

error codes : pure codes error levels : pure codes function to decode these codes (containing the join)

However, @capacma would like a textual description in the CHECK to help the user understand what the error is. Elaborate on the format of the code (for Poland 4 digits where insufficient).

The problem is still open. The ERRORLEVEL and ERRORCODE can be even be a code item from a code list (in order to have a pop-up in an application).

CONCLUSION

first step: @bellomarini and @dragan-ivanovic to produce an example

bellomarini commented 7 years ago

Agree with Dragan's proposal (codes + function). In particola ERRORLEVEL and ERRORCODE should be code items from code lists, containing the description. The code items could be either numeric or strings, to make them self-explanatory.

capacma commented 7 years ago

VTL is designed to exchange validation rules between organisations therefore VTL should be flexible enough to be compatible with different ways of managing messages. Conceptually, an invalid data point is different from a VTL program error therefore this distinction should remain in the way these two completely different concepts are described. A division by zero is a program error while a data point whose values are not conforming to certain validation rules is not an error. In addition: errorcode cannot be only a cryptic code errorlevel should have type string - not integer (e.g. Error, Warning etc.) See explanation in issue #331

errorlevel could be associated to a variable (dictionary, or code list) of error levels. See also issue #330

bellomarini commented 7 years ago

This is an example showing:

DS1

ID1 ID2 ID3 M1
---- ----- ---- ----
a b c 36
e f g -4
h i l 3
m n o -3
DS2 := check(
{mod(DS1,2)=0,  errorcode("ODD_NUMBER"));
DS1<0, errorcode("NEGATIVE_NUMBER");},
all
)

DS2

ID1 ID2 ID3 CONDITION CONDITION_NUMBER ERRORCODE
a b c TRUE 1 null
a b c TRUE 2 null
e f g TRUE 1 null
e f g FALSE 2 NEGATIVE_NUMBER
h i l TRUE 1 ODD_NUMBER
h i l FALSE 2 null
m n o FALSE 1 ODD_NUMBER
m n o FALSE 2 NEGATIVE_NUMBER
CODE ITEM DESCRIPTION
NEGATIVE_NUMBER The number is negative
ODD_NUMBER The number is odd
NEGATIVE_AND_IDD The number is negative and odd

Standardized vs user-defined errors

  1. syntactical errors
  2. compile time errors (semantics)
  3. runtime errors
  4. validation errors (user-defined errors)

Conclusions

Future work