mirror of https://github.com/yandex/odyssey.git
odissey: return corrent message on console error
This commit is contained in:
parent
7fcf7284f8
commit
ca474996d9
|
@ -190,24 +190,28 @@ od_console_query(od_console_t *console, od_msgconsole_t *msg_console)
|
||||||
case OD_PARSER_KEYWORD:
|
case OD_PARSER_KEYWORD:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* error */
|
goto bad_command;
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
od_keyword_t *keyword;
|
od_keyword_t *keyword;
|
||||||
keyword = od_keyword_match(od_console_keywords, &token);
|
keyword = od_keyword_match(od_console_keywords, &token);
|
||||||
if (keyword == NULL) {
|
if (keyword == NULL)
|
||||||
/* error */
|
goto bad_command;
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
switch (keyword->id) {
|
switch (keyword->id) {
|
||||||
case OD_LSHOW:
|
case OD_LSHOW:
|
||||||
return od_console_query_show(console, &parser, msg_console);
|
return od_console_query_show(console, &parser, msg_console);
|
||||||
default:
|
default:
|
||||||
/* error */
|
goto bad_command;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
bad_command:
|
||||||
|
od_error_client(&instance->logger, &client->id, "console",
|
||||||
|
"bad console command");
|
||||||
|
shapito_stream_reset(&client->stream);
|
||||||
|
od_frontend_errorf(client, SHAPITO_SYNTAX_ERROR, "bad console command");
|
||||||
|
shapito_be_write_ready(&client->stream, 'I');
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue