Debian Codegraph @

hmmer/src/errors.c

raw symbols SCIP
1 /* error handling.
2 *
3 * HMMER's fatal error messages distinguish between user errors
4 * ("failure", with p7_Fail()) and internal faults ("death", with
5 * p7_Die()). For now, though, there is no difference between the two
6 * functions. Someday we might have p7_Die() print a comforting
7 * apology, or provide some help on how to report bugs to us;
8 * p7_Fail() might provide some pointers on where to read more
9 * documentation.
10 *
11 * SRE, Fri Jan 12 08:46:02 2007
12 */
13
14 #include <p7_config.h>
15
16 #include <stdlib.h>
17 #include <stdio.h>
18
19 #include "hmmer.h"
20
21 /* Function: p7_Die()
22 * Synopsis: Handle a fatal exception (something that's our fault)
23 * Incept: SRE, Fri Jan 12 08:54:45 2007 [Janelia]
24 */
25 void
26 p7_Die(char *format, ...)
27 {
28 va_list argp;
29 /* format the error mesg */
30 fprintf(stderr, "\nFATAL: ");
31 va_start(argp, format);
32 vfprintf(stderr, format, argp);
33 va_end(argp);
34 fprintf(stderr, "\n");
35 fflush(stderr);
36 exit(1);
37 }
38
39 /* Function: p7_Fail()
40 * Synopsis: Handle a user error (something that's the user's fault).
41 * Incept: SRE, Fri Jan 12 08:54:45 2007 [Janelia]
42 */
43 void
44 p7_Fail(char *format, ...)
45 {
46 va_list argp;
47 /* format the error mesg */
48 fprintf(stderr, "\nError: ");
49 va_start(argp, format);
50 vfprintf(stderr, format, argp);
51 va_end(argp);
52 fprintf(stderr, "\n");
53 fflush(stderr);
54 exit(1);
55 }
56
57
58