mirror of
https://github.com/vim/vim.git
synced 2025-11-15 23:14:06 -05:00
patch 8.2.4012: error messages are spread out
Problem: Error messages are spread out. Solution: Move the last error messages to errors.h.
This commit is contained in:
@@ -707,8 +707,6 @@ channel_gui_unregister(channel_T *channel)
|
||||
|
||||
#endif // FEAT_GUI
|
||||
|
||||
static char *e_cannot_connect = N_("E902: Cannot connect to port");
|
||||
|
||||
/*
|
||||
* For Unix we need to call connect() again after connect() failed.
|
||||
* On Win32 one time is sufficient.
|
||||
@@ -737,7 +735,7 @@ channel_connect(
|
||||
if (sd == -1)
|
||||
{
|
||||
ch_error(channel, "in socket() in channel_connect().");
|
||||
PERROR(_("E898: socket() in channel_connect()"));
|
||||
PERROR(_(e_socket_in_channel_connect));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -778,7 +776,7 @@ channel_connect(
|
||||
{
|
||||
ch_error(channel,
|
||||
"channel_connect: Connect failed with errno %d", errno);
|
||||
PERROR(_(e_cannot_connect));
|
||||
PERROR(_(e_cannot_connect_to_port));
|
||||
sock_close(sd);
|
||||
return -1;
|
||||
}
|
||||
@@ -824,7 +822,7 @@ channel_connect(
|
||||
SOCK_ERRNO;
|
||||
ch_error(channel,
|
||||
"channel_connect: Connect failed with errno %d", errno);
|
||||
PERROR(_(e_cannot_connect));
|
||||
PERROR(_(e_cannot_connect_to_port));
|
||||
sock_close(sd);
|
||||
return -1;
|
||||
}
|
||||
@@ -863,7 +861,7 @@ channel_connect(
|
||||
ch_error(channel,
|
||||
"channel_connect: Connect failed with errno %d",
|
||||
so_error);
|
||||
PERROR(_(e_cannot_connect));
|
||||
PERROR(_(e_cannot_connect_to_port));
|
||||
sock_close(sd);
|
||||
return -1;
|
||||
}
|
||||
@@ -982,8 +980,7 @@ channel_open(
|
||||
if ((err = getaddrinfo(hostname, NULL, &hints, &res)) != 0)
|
||||
{
|
||||
ch_error(channel, "in getaddrinfo() in channel_open()");
|
||||
semsg(_("E901: getaddrinfo() in channel_open(): %s"),
|
||||
gai_strerror(err));
|
||||
semsg(_(e_getaddrinfo_in_channel_open_str), gai_strerror(err));
|
||||
channel_free(channel);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1047,7 +1044,7 @@ channel_open(
|
||||
if ((host = gethostbyname(hostname)) == NULL)
|
||||
{
|
||||
ch_error(channel, "in gethostbyname() in channel_open()");
|
||||
PERROR(_("E901: gethostbyname() in channel_open()"));
|
||||
PERROR(_(e_gethostbyname_in_channel_open));
|
||||
channel_free(channel);
|
||||
return NULL;
|
||||
}
|
||||
@@ -2480,7 +2477,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
|
||||
{
|
||||
ch_error(channel, "received command with non-string argument");
|
||||
if (p_verbose > 2)
|
||||
emsg(_("E903: received command with non-string argument"));
|
||||
emsg(_(e_received_command_with_non_string_argument));
|
||||
return;
|
||||
}
|
||||
arg = argv[1].vval.v_string;
|
||||
@@ -2537,13 +2534,13 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
|
||||
{
|
||||
ch_error(channel, "last argument for expr/call must be a number");
|
||||
if (p_verbose > 2)
|
||||
emsg(_("E904: last argument for expr/call must be a number"));
|
||||
emsg(_(e_last_argument_for_expr_call_must_be_number));
|
||||
}
|
||||
else if (is_call && argv[2].v_type != VAR_LIST)
|
||||
{
|
||||
ch_error(channel, "third argument for call must be a list");
|
||||
if (p_verbose > 2)
|
||||
emsg(_("E904: third argument for call must be a list"));
|
||||
emsg(_(e_third_argument_for_call_must_be_list));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2600,7 +2597,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
|
||||
else if (p_verbose > 2)
|
||||
{
|
||||
ch_error(channel, "Received unknown command: %s", (char *)cmd);
|
||||
semsg(_("E905: received unknown command: %s"), cmd);
|
||||
semsg(_(e_received_unknown_command_str), cmd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3843,7 +3840,7 @@ get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part)
|
||||
if (check_open && (channel == NULL || (!channel_is_open(channel)
|
||||
&& !(reading && has_readahead))))
|
||||
{
|
||||
emsg(_("E906: not an open channel"));
|
||||
emsg(_(e_not_an_open_channel));
|
||||
return NULL;
|
||||
}
|
||||
return channel;
|
||||
@@ -4245,7 +4242,7 @@ send_common(
|
||||
{
|
||||
if (eval)
|
||||
{
|
||||
semsg(_("E917: Cannot use a callback with %s()"), fun);
|
||||
semsg(_(e_cannot_use_callback_with_str), fun);
|
||||
return NULL;
|
||||
}
|
||||
channel_set_req_callback(channel, *part_read, &opt->jo_callback, id);
|
||||
@@ -4290,7 +4287,7 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval)
|
||||
ch_mode = channel_get_mode(channel, part_send);
|
||||
if (ch_mode == MODE_RAW || ch_mode == MODE_NL)
|
||||
{
|
||||
emsg(_("E912: cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel"));
|
||||
emsg(_(e_cannot_use_evalexpr_sendexpr_with_raw_or_nl_channel));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user