Skip to content

Commit

Permalink
cmd/flux-job: fix module not loaded error
Browse files Browse the repository at this point in the history
Improve error handling in flux-job submitbench to
be more helpful if a job is submitted while the job-ingest
module is not loaded.

Also, avoid printing "(null)" when there is no textual
error message available in the future.
  • Loading branch information
garlick committed Aug 27, 2018
1 parent c55e014 commit 2153618
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/cmd/flux-job.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,16 @@ void submitbench_continuation (flux_future_t *f, void *arg)
{
struct submitbench_ctx *ctx = arg;
flux_jobid_t id;

if (flux_job_submit_get_id (f, &id) < 0)
log_err_exit ("%s", flux_future_error_string (f));
const char *errmsg;

if (flux_job_submit_get_id (f, &id) < 0) {
if (errno == ENOSYS)
log_msg_exit ("submit: job-ingest module is not loaded");
else if ((errmsg = flux_future_error_string (f)))
log_msg_exit ("submit: %s", errmsg);
else
log_err_exit ("submit");
}
printf ("%llu\n", (unsigned long long)id);
flux_future_destroy (f);

Expand Down

0 comments on commit 2153618

Please sign in to comment.