Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/neuron/errcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ typedef enum {
NEU_ERR_PLUGIN_NOT_SUPPORT_FDOWN_DATA = 3028,
NEU_ERR_PLUGIN_NOT_SUPPORT_IMPORT_TAGS = 3029,

NEU_ERR_PLUGIN_APP_NOT_RUNNING = 3030,

NEU_ERR_MQTT_FAILURE = 4000,
NEU_ERR_MQTT_NO_CERTFILESET = 4001,
NEU_ERR_MQTT_CERTFILE_LOAD_FAILURE = 4002,
Expand Down
2 changes: 1 addition & 1 deletion plugins/datalayers/datalayers_handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ int handle_trans_data(neu_plugin_t * plugin,

if (plugin->common.link_state != NEU_NODE_LINK_STATE_CONNECTED) {
pthread_rwlock_unlock(&plugin->plugin_mutex);
return NEU_ERR_PLUGIN_NOT_RUNNING;
return NEU_ERR_PLUGIN_APP_NOT_RUNNING;
}

const route_entry_t *route = route_tbl_get(
Expand Down
4 changes: 2 additions & 2 deletions plugins/kafka/kafka_handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int handle_trans_data(neu_plugin_t *plugin, neu_reqresp_trans_data_t *data)
int rv = 0;

if (NULL == plugin->rk) {
return NEU_ERR_PLUGIN_NOT_RUNNING;
return NEU_ERR_PLUGIN_APP_NOT_RUNNING;
}

const kafka_route_entry_t *route =
Expand Down Expand Up @@ -176,7 +176,7 @@ int handle_trans_data(neu_plugin_t *plugin, neu_reqresp_trans_data_t *data)
}

free(json_str);
return rv == 0 ? NEU_ERR_SUCCESS : NEU_ERR_PLUGIN_NOT_RUNNING;
return rv == 0 ? NEU_ERR_SUCCESS : NEU_ERR_PLUGIN_APP_NOT_RUNNING;
}

int handle_subscribe_group(neu_plugin_t *plugin, neu_req_subscribe_t *sub)
Expand Down
6 changes: 3 additions & 3 deletions plugins/kafka/kafka_plugin_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static int kafka_plugin_config(neu_plugin_t *plugin, const char *setting)
if (NULL == plugin->rk) {
plog_error(plugin, "create kafka producer fail");
kafka_config_fini(&config);
return NEU_ERR_PLUGIN_NOT_RUNNING;
return NEU_ERR_PLUGIN_APP_NOT_RUNNING;
}

if (0 != start_poll_timer(plugin)) {
Expand All @@ -375,7 +375,7 @@ static int kafka_plugin_start(neu_plugin_t *plugin)
{
if (NULL == plugin->rk) {
plog_error(plugin, "kafka producer is NULL");
return NEU_ERR_PLUGIN_NOT_RUNNING;
return NEU_ERR_PLUGIN_APP_NOT_RUNNING;
}

if (0 != start_poll_timer(plugin)) {
Expand Down Expand Up @@ -445,7 +445,7 @@ static int kafka_plugin_request(neu_plugin_t *plugin, neu_reqresp_head_t *head,
break;
}
default:
error = NEU_ERR_PLUGIN_NOT_RUNNING;
error = NEU_ERR_PLUGIN_APP_NOT_RUNNING;
break;
}

Expand Down
1 change: 1 addition & 0 deletions src/utils/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ int neu_http_response(nng_aio *aio, neu_err_code_e code, char *content)
case NEU_ERR_GROUP_ALREADY_SUBSCRIBED:
case NEU_ERR_PLUGIN_PROTOCOL_DECODE_FAILURE:
case NEU_ERR_PLUGIN_NOT_RUNNING:
case NEU_ERR_PLUGIN_APP_NOT_RUNNING:
case NEU_ERR_PLUGIN_TAG_NOT_READY:
case NEU_ERR_PLUGIN_PACKET_OUT_OF_ORDER:
case NEU_ERR_MQTT_FAILURE:
Expand Down
4 changes: 2 additions & 2 deletions tests/ft/node/test_node_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_update_tags_of_node_to_empty(self):

@description(given="existent driver node", when="add tags with invalid symbol", then="add failed")
def test_add_tags_with_invalid_symbol(self):
response = api.add_node_with_tags(node="modbus-tcp-2", plugin=PLUGIN_MODBUS_TCP, tags="tag1,tag@2")
response = api.add_node_with_tags(node="modbus-tcp-2", plugin=PLUGIN_MODBUS_TCP, tags="tag1,tag?2")
assert 400 == response.status_code
assert NEU_ERR_NODE_TAGS_INVALID == response.json()['error']

Expand All @@ -44,7 +44,7 @@ def test_update_tags_with_invalid_symbol(self):
response = api.add_node(node="modbus-tcp-2", plugin=PLUGIN_MODBUS_TCP)
assert 200 == response.status_code
assert NEU_ERR_SUCCESS == response.json()['error']
response = api.update_node_tags(node="modbus-tcp-2", tags="tag#3,tag4")
response = api.update_node_tags(node="modbus-tcp-2", tags="tag?3,tag4")
assert 400 == response.status_code
assert NEU_ERR_NODE_TAGS_INVALID == response.json()['error']

Expand Down
Loading