Skip to content

Commit 6ed8137

Browse files
committed
flux-job: info: use original jobid in error message
Problem: The flux-job info subcommand always uses the decimal encoding of the jobid in the error message when the job or key is not found. This could be confusing to users. Preserve and use the original jobid argument in any error message.
1 parent 0073f5b commit 6ed8137

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cmd/flux-job.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3283,6 +3283,7 @@ void info_usage (void)
32833283
}
32843284

32853285
struct info_ctx {
3286+
const char *id_arg;
32863287
flux_jobid_t id;
32873288
json_t *keys;
32883289
bool original;
@@ -3295,7 +3296,7 @@ void info_output (flux_future_t *f, const char *suffix, struct info_ctx *ctx)
32953296
if (flux_rpc_get_unpack (f, "{s:s}", suffix, &s) < 0) {
32963297
if (errno == ENOENT) {
32973298
flux_future_destroy (f);
3298-
log_msg_exit ("job %ju id or key not found", (uintmax_t)ctx->id);
3299+
log_msg_exit ("job %s id or key not found", ctx->id_arg);
32993300
}
33003301
else
33013302
log_err_exit ("flux_rpc_get_unpack");
@@ -3340,6 +3341,7 @@ void info_lookup (flux_t *h,
33403341
flux_future_t *f;
33413342
struct info_ctx ctx = {0};
33423343

3344+
ctx.id_arg = argv[optindex-1];
33433345
ctx.id = id;
33443346
if (!(ctx.keys = json_array ()))
33453347
log_msg_exit ("json_array");

0 commit comments

Comments
 (0)