Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • The benefit of setField method being used, and will my throw dbe throw out this setField method value too.. Commented Oct 16, 2010 at 23:23
  • @John: Not sure if I'm parsing your comment correctly, but I'll give it a go: The benefit of adding state to a custom exception -- i.e., adding a custom field and allowing you to set it using setField() -- is that you can propagate out state/error information to outer scopes that catch the exception. This obviates the need to explicitly pass out error or status via other means. And yes, if you call setField(something) on your dbe instance, then the code which catches the exception would be able to see it -- you might want to add a DBGlobalsException.getField() method for that. Commented Oct 16, 2010 at 23:33