Menu

capturing errors during setup

Anonymous
2005-05-31
2013-04-25
  • Anonymous

    Anonymous - 2005-05-31

    Is there a way to capture SQL exceptions that occur during the setup phase?  I find that when trying to do anything non-trivial during setup, I often get some things wrong the first time around, but since SQLUnit swallows the exceptions without reporting them anywhere, the only way I can figure out what happened is if I turn on debugging, which gives me a ton of information I don't need.  Am I missing an option to dump SQL exceptions to the results file somehow?

    I've read through the code and if I'm reading it correctly it appears to purposely be swallowing the exceptions.

     
    • Sujit Pal

      Sujit Pal - 2005-05-31

      Hi trcull,

      I dont thnk that there is a way to capture the exceptions since they are being swallowed as you pointed out. I could make this throw the exception as an SQLUnitException which can then be displayed on the console.

      I will do this and post here again when I am done.

      -sujit

       
    • Sujit Pal

      Sujit Pal - 2005-06-01

      I misunderstood your request and went looking for exception swallowing in the handlers and found that they were not. However, I think I got what you wanted, and I have removed the if condition that was being checked in SQLUnit.
      if (debug) {
          throw the entire stack trace
      } else {
          throw a more civilized one liner
      }
      is now:
          throw the entire stack trace

      I guess this is all right, since if you do get a problem, you want to see where it is without going to debug mode.

      Here are the files you will need to download to get the fix (it has got another fix which is why you see files which appear unrelated).
      Checking in src/net/sourceforge/sqlunit/Assertions.java;
      /cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/Assertions.java,v  <--  Assertions.java
      new revision: 1.20; previous revision: 1.19
      done
      Checking in src/net/sourceforge/sqlunit/SQLUnit.java;
      /cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/SQLUnit.java,v  <--  SQLUnit.java
      new revision: 1.52; previous revision: 1.51
      done
      Checking in src/net/sourceforge/sqlunit/handlers/ParamHandler.java;
      /cvsroot/sqlunit/sqlunit/src/net/sourceforge/sqlunit/handlers/ParamHandler.java,v  <--  ParamHandler.java
      new revision: 1.10; previous revision: 1.9
      done

      -sujit

       
    • Anonymous

      Anonymous - 2005-06-02

      Awesome, thanks.  I must have been misreading the code when I though it was being swallowed.

       
    • Sujit Pal

      Sujit Pal - 2005-06-02

      Hi,

      I will name you as one of the feature requesters for the next release. If you would like to be known by a real name, then please let me know that. If trcull is fine with you, I can use that too.

      Thanks
      Sujit

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.