Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Any client code that possesses the required permissions can override the ExceptionReporter with a handler that logs the error, or provides a dialog box, or both. For instance, a GUI client using Swing may require exceptions to be reported using a dialog box:

Code Block
bgColor#ccccff
ExceptionReportersExceptionReporter.setExceptionReporter(new ExceptionReporter() {
  public void report(Throwable exception) {
    JOptionPane.showMessageDialog(frame,
                                  exception.toString,
                                  exception.getClass().getName(),
                                  JOptionPane.ERROR_MESSAGE);
  });
}

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="6aec59c305400ddd-b5022d4b-4fd94dfe-88488171-b8ee5c7379d8966b6eaef649"><ac:plain-text-body><![CDATA[

[[Bloch 2008

AA. Bibliography#Bloch 08]]

Item 65: "Don't ignore exceptions" and Item 62: "Document all exceptions thrown by each method"

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="4e9d8f4018f5ff06-349529cc-4d4145f3-bd6198fe-331bdbfe6b5b03064c4adeae"><ac:plain-text-body><![CDATA[

[[Goetz 2006

AA. Bibliography#Goetz 06]]

5.4 Blocking and interruptible methods

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b3383fc2d796324a-31d222b8-43124640-8c6088d3-08b4357862c95eb1470e0c64"><ac:plain-text-body><![CDATA[

[[JLS 2005

AA. Bibliography#JLS 05]]

[Chapter 11, Exceptions

http://java.sun.com/docs/books/jls/third_edition/html/exceptions.html]

]]></ac:plain-text-body></ac:structured-macro>

...