OSSP CVS Repository

ossp - Check-in [3212]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3212
Date: 2003-Feb-11 12:41:11 (local)
2003-Feb-11 11:41:11 (UTC)
User:thl
Branch:
Comment: controlled exit when configuration throws exception
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/lmtp2nntp_config.h      1.11 -> 1.12     1 inserted, 0 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp_main.c      1.68 -> 1.69     8 inserted, 1 deleted

ossp-pkg/lmtp2nntp/lmtp2nntp_config.h 1.11 -> 1.12

--- lmtp2nntp_config.h   2003/01/30 19:42:13     1.11
+++ lmtp2nntp_config.h   2003/02/11 11:41:11     1.12
@@ -35,6 +35,7 @@
 typedef enum {
     CONFIG_OK,
     CONFIG_OK_DRY,  /* dry run short circuit i.e. --testfile or --version */
+    CONFIG_ERR_TRY, /* caught an exception from a underlying codeblock */
     CONFIG_ERR_LOG  /* cannot initialize logging */
 } lmtp2nntp_config_rc_t;
 


ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.68 -> 1.69

--- lmtp2nntp_main.c     2003/02/10 14:25:39     1.68
+++ lmtp2nntp_main.c     2003/02/11 11:41:11     1.69
@@ -464,11 +464,18 @@
     {
         lmtp2nntp_option_rc_t rvo;
         lmtp2nntp_config_rc_t rvc;
+        ex_t ex;
 
         if (option_create(&o, ctx->val) != OPTION_OK)
             CU(ERR_EXECUTION);
         rvo = option_parse(o, argc, argv);
-        rvc = config_context(ctx);
+        rvc = CONFIG_OK;
+        try {
+            rvc = config_context(ctx);
+        }
+        catch(ex) {
+            rvc = CONFIG_ERR_TRY;
+        }
         if (rvc == CONFIG_OK_DRY)
             CU(0);
         if (rvo != OPTION_OK || rvc != CONFIG_OK)

CVSTrac 2.0.1