K2InformaticsGmbH / oranif

Oracle OCI driver using dirty NIF
Apache License 2.0
4 stars 2 forks source link

Fix error message #111

Closed c-bik closed 5 years ago

c-bik commented 5 years ago

https://github.com/K2InformaticsGmbH/oranif/blob/7f827a5352141d69f6f472e251e4b8a533166b5b/c_src/dpiStmt_nif.c#L29-L30 https://github.com/K2InformaticsGmbH/oranif/blob/7f827a5352141d69f6f472e251e4b8a533166b5b/c_src/dpiStmt_nif.c#L38-L39 also in https://github.com/K2InformaticsGmbH/oranif/pull/110#issue-296777914

c-bik commented 5 years ago

Sugggestions:

if (!enif_get_list_length(env, argv[1], &len)) 
     BADARG_EXCEPTION(1, "list of atoms"); 

Then the error message in erlang will read like: "Unable to retrieve list of atoms from arg1"

if (!enif_is_atom(env, head)) 
     RAISE_STR_EXCEPTION("mode must be a list of atoms"); 
c-bik commented 5 years ago

fixed by https://github.com/K2InformaticsGmbH/oranif/pull/112