[augeas-devel] augeas: master - * src/syntax.c: spew exceptions less often
David Lutterkort
lutter at fedoraproject.org
Fri Nov 13 19:26:50 UTC 2009
Gitweb: http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=adfc3c0082139324d458b1f5ebbb46b1c5492049
Commit: adfc3c0082139324d458b1f5ebbb46b1c5492049
Parent: c059a71193bcebcb7a5468b68f88e00a1704b4ca
Author: David Lutterkort <lutter at redhat.com>
AuthorDate: Wed Nov 11 15:58:34 2009 -0800
Committer: David Lutterkort <lutter at redhat.com>
CommitterDate: Fri Nov 13 10:44:29 2009 -0800
* src/syntax.c: spew exceptions less often
print_value: only print exceptions that haven't been seen
compile_test: only print the exception for a test when it hasn't
been seen
---
src/syntax.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/syntax.c b/src/syntax.c
index 77a4dd1..686d0c8 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -709,10 +709,13 @@ static void print_value(FILE *out, struct value *v) {
fprintf(out, ">");
break;
case V_EXN:
- print_info(out, v->exn->info);
- fprintf(out, "exception: %s\n", v->exn->message);
- for (int i=0; i < v->exn->nlines; i++) {
- fprintf(out, " %s\n", v->exn->lines[i]);
+ if (! v->exn->seen) {
+ print_info(out, v->exn->info);
+ fprintf(out, "exception: %s\n", v->exn->message);
+ for (int i=0; i < v->exn->nlines; i++) {
+ fprintf(out, " %s\n", v->exn->lines[i]);
+ }
+ v->exn->seen = 1;
}
break;
default:
@@ -1676,7 +1679,8 @@ static int compile_test(struct term *term, struct ctx *ctx) {
}
} else {
if (EXN(actual)) {
- printf("Test run encountered exception:\n");
+ print_info(stdout, term->info);
+ printf("exception thrown in test\n");
print_value(stdout, actual);
printf("\n");
ret = 0;
More information about the augeas-devel
mailing list