summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-13 15:17:58 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-13 15:17:58 +0100
commitb3292fa2d362b064ff8a115fc0ad794c1f1265d7 (patch)
tree79b4fdcf2368cca8313256f21c0c4e9f7f99f319
parentab5e7c3deb40328e1c7d40534ed8cd9da47a92f8 (diff)
downloadvim-git-b3292fa2d362b064ff8a115fc0ad794c1f1265d7.tar.gz
patch 8.0.1516: errors for job options are not very specificv8.0.1516
Problem: Errors for job options are not very specific. Solution: Add more specific error messages.
-rw-r--r--src/channel.c34
-rw-r--r--src/globals.h2
-rw-r--r--src/version.c2
3 files changed, 21 insertions, 17 deletions
diff --git a/src/channel.c b/src/channel.c
index 77df42dd9..93c809ca6 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -4458,7 +4458,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
return OK;
if (tv->v_type != VAR_DICT)
{
- EMSG(_(e_invarg));
+ EMSG(_(e_dictreq));
return FAIL;
}
dict = tv->vval.v_dict;
@@ -4541,7 +4541,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_io_buf[part] = get_tv_number(item);
if (opt->jo_io_buf[part] <= 0)
{
- EMSG2(_(e_invarg2), get_tv_string(item));
+ EMSG3(_(e_invargNval), hi->hi_key, get_tv_string(item));
return FAIL;
}
if (buflist_findnr(opt->jo_io_buf[part]) == NULL)
@@ -4590,7 +4590,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
*lp = get_tv_number(item);
if (*lp < 0)
{
- EMSG2(_(e_invarg2), get_tv_string(item));
+ EMSG3(_(e_invargNval), hi->hi_key, get_tv_string(item));
return FAIL;
}
}
@@ -4601,7 +4601,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_set |= JO_CHANNEL;
if (item->v_type != VAR_CHANNEL)
{
- EMSG2(_(e_invarg2), "channel");
+ EMSG2(_(e_invargval), "channel");
return FAIL;
}
opt->jo_channel = item->vval.v_channel;
@@ -4614,7 +4614,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_callback = get_callback(item, &opt->jo_partial);
if (opt->jo_callback == NULL)
{
- EMSG2(_(e_invarg2), "callback");
+ EMSG2(_(e_invargval), "callback");
return FAIL;
}
}
@@ -4626,7 +4626,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_out_cb = get_callback(item, &opt->jo_out_partial);
if (opt->jo_out_cb == NULL)
{
- EMSG2(_(e_invarg2), "out_cb");
+ EMSG2(_(e_invargval), "out_cb");
return FAIL;
}
}
@@ -4638,7 +4638,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_err_cb = get_callback(item, &opt->jo_err_partial);
if (opt->jo_err_cb == NULL)
{
- EMSG2(_(e_invarg2), "err_cb");
+ EMSG2(_(e_invargval), "err_cb");
return FAIL;
}
}
@@ -4650,7 +4650,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_close_cb = get_callback(item, &opt->jo_close_partial);
if (opt->jo_close_cb == NULL)
{
- EMSG2(_(e_invarg2), "close_cb");
+ EMSG2(_(e_invargval), "close_cb");
return FAIL;
}
}
@@ -4663,7 +4663,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
never = TRUE;
else if (STRCMP(val, "auto") != 0)
{
- EMSG2(_(e_invarg2), "drop");
+ EMSG3(_(e_invargNval), "drop", val);
return FAIL;
}
opt->jo_drop_never = never;
@@ -4676,7 +4676,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_exit_cb = get_callback(item, &opt->jo_exit_partial);
if (opt->jo_exit_cb == NULL)
{
- EMSG2(_(e_invarg2), "exit_cb");
+ EMSG2(_(e_invargval), "exit_cb");
return FAIL;
}
}
@@ -4689,7 +4689,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_term_name = get_tv_string_chk(item);
if (opt->jo_term_name == NULL)
{
- EMSG2(_(e_invarg2), "term_name");
+ EMSG2(_(e_invargval), "term_name");
return FAIL;
}
}
@@ -4700,7 +4700,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
val = get_tv_string(item);
if (STRCMP(val, "open") != 0 && STRCMP(val, "close") != 0)
{
- EMSG2(_(e_invarg2), val);
+ EMSG3(_(e_invargNval), "term_finish", val);
return FAIL;
}
opt->jo_set2 |= JO2_TERM_FINISH;
@@ -4724,7 +4724,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
}
if (p == NULL)
{
- EMSG2(_(e_invarg2), "term_opencmd");
+ EMSG2(_(e_invargval), "term_opencmd");
return FAIL;
}
}
@@ -4738,7 +4738,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
p = opt->jo_eof_chars = get_tv_string_chk(item);
if (p == NULL)
{
- EMSG2(_(e_invarg2), "term_opencmd");
+ EMSG2(_(e_invargval), "eof_chars");
return FAIL;
}
}
@@ -4793,7 +4793,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_cwd = get_tv_string_buf_chk(item, opt->jo_cwd_buf);
if (opt->jo_cwd == NULL || !mch_isdir(opt->jo_cwd))
{
- EMSG2(_(e_invarg2), "cwd");
+ EMSG2(_(e_invargval), "cwd");
return FAIL;
}
opt->jo_set |= JO2_CWD;
@@ -4838,7 +4838,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_part = PART_OUT;
else
{
- EMSG2(_(e_invarg2), val);
+ EMSG3(_(e_invargNval), "part", val);
return FAIL;
}
}
@@ -4858,7 +4858,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_soe_buf);
if (opt->jo_stoponexit == NULL)
{
- EMSG2(_(e_invarg2), "stoponexit");
+ EMSG2(_(e_invargval), "stoponexit");
return FAIL;
}
}
diff --git a/src/globals.h b/src/globals.h
index 2504d2ec4..225e78a65 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1437,6 +1437,8 @@ EXTERN char_u e_interr[] INIT(= N_("Interrupted"));
EXTERN char_u e_invaddr[] INIT(= N_("E14: Invalid address"));
EXTERN char_u e_invarg[] INIT(= N_("E474: Invalid argument"));
EXTERN char_u e_invarg2[] INIT(= N_("E475: Invalid argument: %s"));
+EXTERN char_u e_invargval[] INIT(= N_("E475: Invalid value for argument %s"));
+EXTERN char_u e_invargNval[] INIT(= N_("E475: Invalid value for argument %s: %s"));
#ifdef FEAT_EVAL
EXTERN char_u e_invexpr2[] INIT(= N_("E15: Invalid expression: %s"));
#endif
diff --git a/src/version.c b/src/version.c
index 52479de74..9e1983342 100644
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1516,
+/**/
1515,
/**/
1514,