mirror of
https://github.com/emqx/neuron.git
synced 2026-10-18 13:41:22 +08:00
Merge pull request #2943 from fengzeroz/main
errorcode: app not running
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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 =
|
||||
@@ -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)
|
||||
|
||||
@@ -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)) {
|
||||
@@ -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)) {
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -35,7 +35,7 @@ class TestNodeTag:
|
||||
|
||||
@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']
|
||||
|
||||
@@ -44,7 +44,7 @@ class TestNodeTag:
|
||||
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']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user