Skip to content

Commit 6145742

Browse files
committed
improvements to error reporting
1 parent 201b693 commit 6145742

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

genodsp.c

+11-4
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,8 @@ static void parse_options (int _argc, char** _argv)
599599
exit(EXIT_FAILURE);
600600

601601
no_length:
602-
fprintf (stderr, "\"%s\" contains no chromosome length\n",
602+
fprintf (stderr, "\"%s\" contains no chromosome length\n"
603+
"(expected \"chromosome:length\" or \"chromosome:start:end\")\n",
603604
arg);
604605
exit (EXIT_FAILURE);
605606
}
@@ -1458,6 +1459,9 @@ int read_interval
14581459

14591460
//////////
14601461
// failure exits
1462+
//
1463+
// nota bene: I'd like to report the line's contents with these messages,
1464+
// but the line has usually been modified before we get here
14611465
//////////
14621466

14631467
missing_eol:
@@ -1471,17 +1475,20 @@ int read_interval
14711475
exit (EXIT_FAILURE);
14721476

14731477
no_start:
1474-
fprintf (stderr, "problem at line %u, line contains no interval start\n",
1478+
fprintf (stderr, "problem at line %u, line contains no interval start\n"
1479+
"(expected \"chromosome start end ...\", but there are fewer than 2 fields)\n",
14751480
lineNumber);
14761481
exit (EXIT_FAILURE);
14771482

14781483
no_end:
1479-
fprintf (stderr, "problem at line %u, line contains no interval end\n",
1484+
fprintf (stderr, "problem at line %u, line contains no interval end\n"
1485+
"(expected \"chromosome start end ...\", but there are fewer than 3 fields)\n",
14801486
lineNumber);
14811487
exit (EXIT_FAILURE);
14821488

14831489
no_value:
1484-
fprintf (stderr, "problem at line %u, line contains no interval value\n",
1490+
fprintf (stderr, "problem at line %u, line contains no interval value\n"
1491+
"(expected \"chromosome start end value\", but there are fewer than 4 fields)\n",
14851492
lineNumber);
14861493
exit (EXIT_FAILURE);
14871494
}

0 commit comments

Comments
 (0)