|
48 | 48 | #define JS_GET_OBJECT_TYPE ((CWS_CONFIG *)(js_cws_instance->soap_internal->user))->object_type |
49 | 49 | #define JS_GET_CWS_CONFIG ((CWS_CONFIG *)(js_cws_instance->soap_internal->user)) |
50 | 50 | #define JS_GET_ERROR ((CWS_CONFIG *)(js_cws_instance->soap_internal->user))->internal_soap_error |
| 51 | +#define JS_GET_FAULT_STRING ((CWS_CONFIG *)(js_cws_instance->soap_internal->user))->cws_soap_fault.faultstring |
| 52 | +#define JS_GET_FAULT_STRING_LEN ((CWS_CONFIG *)(js_cws_instance->soap_internal->user))->cws_soap_fault.faultstring_len |
| 53 | +#define JS_GET_XML_FAULT_DETAIL ((CWS_CONFIG *)(js_cws_instance->soap_internal->user))->cws_soap_fault.XMLfaultdetail |
| 54 | +#define JS_GET_XML_FAULT_DETAIL_LEN ((CWS_CONFIG *)(js_cws_instance->soap_internal->user))->cws_soap_fault.XMLfaultdetail_len |
51 | 55 |
|
52 | 56 | #define ERR js_cws_instance->err |
53 | 57 |
|
@@ -1116,13 +1120,89 @@ _Static_assert(sizeof(uint64_t)>=sizeof(size_t), "Archtecture error. Refactor it |
1116 | 1120 | return res; |
1117 | 1121 | } |
1118 | 1122 |
|
| 1123 | +napi_value c_getFaultString(napi_env env, napi_callback_info info) |
| 1124 | +{ |
| 1125 | + napi_value argv=NULL, res; |
| 1126 | + size_t argc=0; |
| 1127 | + struct js_cws_config_t *js_cws_instance; |
| 1128 | + struct cws_js_err_t cws_js_err; |
| 1129 | + |
| 1130 | + JS_CWS_THROW_COND( |
| 1131 | + napi_get_cb_info(env, info, &argc, &argv, NULL, (void **)&js_cws_instance)!=napi_ok, |
| 1132 | + "napi_get_cb_info", |
| 1133 | + "Can't parse arguments. Wrong argument at c_getFaultString", |
| 1134 | + 200 |
| 1135 | + ) |
| 1136 | + |
| 1137 | + JS_CWS_THROW_COND(argc, "c_getFaultString", "Too many arguments @ c_getFaultString", 201) |
| 1138 | + |
| 1139 | + JS_CWS_THROW_COND( |
| 1140 | + (js_cws_instance==NULL), |
| 1141 | + "c_getFaultString", |
| 1142 | + "Fatal: js_cws_instance @ c_getFaultString. Was expected NOT NULL", |
| 1143 | + 202 |
| 1144 | + ) |
| 1145 | + |
| 1146 | + if (JS_GET_FAULT_STRING) { |
| 1147 | + JS_CWS_THROW_COND( |
| 1148 | + (napi_create_string_utf8(env, JS_GET_FAULT_STRING, JS_GET_FAULT_STRING_LEN, &res)!=napi_ok), |
| 1149 | + "napi_create_string_utf8", |
| 1150 | + "napi_create_string_utf8 @ c_getFaultString. Error on parsing fault string message", |
| 1151 | + 203 |
| 1152 | + ) |
| 1153 | + |
| 1154 | + return res; |
| 1155 | + } |
| 1156 | + |
| 1157 | + JS_CWS_RETURN_NULL |
| 1158 | +} |
| 1159 | + |
| 1160 | +napi_value c_getXMLfaultdetail(napi_env env, napi_callback_info info) |
| 1161 | +{ |
| 1162 | + napi_value argv=NULL, res; |
| 1163 | + size_t argc=0; |
| 1164 | + struct js_cws_config_t *js_cws_instance; |
| 1165 | + struct cws_js_err_t cws_js_err; |
| 1166 | + |
| 1167 | + JS_CWS_THROW_COND( |
| 1168 | + napi_get_cb_info(env, info, &argc, &argv, NULL, (void **)&js_cws_instance)!=napi_ok, |
| 1169 | + "napi_get_cb_info", |
| 1170 | + "Can't parse arguments. Wrong argument at c_getXMLfaultdetail", |
| 1171 | + 210 |
| 1172 | + ) |
| 1173 | + |
| 1174 | + JS_CWS_THROW_COND(argc, "c_getXMLfaultdetail", "Too many arguments @ c_getXMLfaultdetail", 211) |
| 1175 | + |
| 1176 | + JS_CWS_THROW_COND( |
| 1177 | + (js_cws_instance==NULL), |
| 1178 | + "c_getXMLfaultdetail", |
| 1179 | + "Fatal: js_cws_instance @ c_getXMLfaultdetail. Was expected NOT NULL", |
| 1180 | + 212 |
| 1181 | + ) |
| 1182 | + |
| 1183 | + if (JS_GET_XML_FAULT_DETAIL) { |
| 1184 | + JS_CWS_THROW_COND( |
| 1185 | + (napi_create_string_utf8(env, JS_GET_XML_FAULT_DETAIL, JS_GET_XML_FAULT_DETAIL_LEN, &res)!=napi_ok), |
| 1186 | + "napi_create_string_utf8", |
| 1187 | + "napi_create_string_utf8 @ c_getXMLfaultdetail. Error on parsing XML fault detail string message", |
| 1188 | + 213 |
| 1189 | + ) |
| 1190 | + |
| 1191 | + return res; |
| 1192 | + } |
| 1193 | + |
| 1194 | + JS_CWS_RETURN_NULL |
| 1195 | +} |
| 1196 | + |
1119 | 1197 | CWS_JS_FUNCTIONS_OBJ CWS_JS_CREATE_FUNCTIONS[] = { |
1120 | 1198 | SET_JS_FN_CALL(getInstanceName), |
1121 | 1199 | SET_JS_FN_CALL(getObjectName), |
1122 | 1200 | SET_JS_FN_CALL(getObjectType), |
1123 | 1201 | SET_JS_FN_CALL(getBsonBytes), |
1124 | 1202 | SET_JS_FN_CALL(getJson), |
1125 | 1203 | SET_JS_FN_CALL(getStatistics), |
| 1204 | + SET_JS_FN_CALL(getFaultString), |
| 1205 | + SET_JS_FN_CALL(getXMLfaultdetail), |
1126 | 1206 | SET_JS_FN_CALL(getError), |
1127 | 1207 | SET_JS_FN_CALL(parse), |
1128 | 1208 | SET_JS_FN_CALL(parseToJSON), |
|
0 commit comments