01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: package de.uka.ilkd.key.util;
12:
13: import de.uka.ilkd.key.proof.init.ProofInputException;
14:
15: public class KeYExceptionHandlerImpl implements KeYExceptionHandler {
16:
17: protected ExtList exceptions = null;
18:
19: public KeYExceptionHandlerImpl() {
20: exceptions = new ExtList();
21: }
22:
23: public void reportException(Throwable e) {
24: if (e != ProofInputException.USER_ABORT_EXCEPTION) {
25: exceptions.add(e);
26: } else {
27: // HACK avoids annoying error dialog after the user
28: // cancelled loading of a proof with the JMLSpecBrowser
29: }
30: }
31:
32: public ExtList getExceptions() {
33: return exceptions;
34: }
35:
36: /** errors?
37: * @return boolean true if errors or exceptions were reported,
38: * false otherwise
39: */
40: public boolean error() {
41: return !exceptions.isEmpty();
42: }
43:
44: public void clear() {
45: exceptions = new ExtList();
46: }
47:
48: }
|