Bläddra i källkod

Fix parser errors.

pull/77/head
Greg Holmes 9 år sedan
förälder
incheckning
27c3b0677d

+ 3
- 6
common/src/com/dmdirc/parser/common/CallbackManager.java Visa fil

26
 import com.dmdirc.parser.events.ParserEvent;
26
 import com.dmdirc.parser.events.ParserEvent;
27
 import com.dmdirc.parser.interfaces.Parser;
27
 import com.dmdirc.parser.interfaces.Parser;
28
 
28
 
29
-import com.google.common.base.Throwables;
30
-
31
 import java.util.Date;
29
 import java.util.Date;
32
 
30
 
33
 import net.engio.mbassy.bus.MBassador;
31
 import net.engio.mbassy.bus.MBassador;
89
             }
87
             }
90
 
88
 
91
             synchronized (errorHandlerLock) {
89
             synchronized (errorHandlerLock) {
92
-                final Throwable error = e.getCause().getCause();
93
-                publish(new ParserErrorEvent(parser, new Date(),
94
-                        new ParserError(ParserError.ERROR_EXCEPTION,
95
-                        error.getMessage(), Throwables.getStackTraceAsString(error))));
90
+                publish(new ParserErrorEvent(parser, new Date(), new Exception(
91
+                        "Message: " + e.getCause().getCause().getMessage() + " in Handler: "
92
+                                + e.getHandler(), e.getCause().getCause())));
96
             }
93
             }
97
         });
94
         });
98
     }
95
     }

+ 5
- 6
common/src/com/dmdirc/parser/events/ParserErrorEvent.java Visa fil

22
 
22
 
23
 package com.dmdirc.parser.events;
23
 package com.dmdirc.parser.events;
24
 
24
 
25
-import com.dmdirc.parser.common.ParserError;
26
 import com.dmdirc.parser.interfaces.Parser;
25
 import com.dmdirc.parser.interfaces.Parser;
27
 
26
 
28
 import java.util.Date;
27
 import java.util.Date;
32
  */
31
  */
33
 public class ParserErrorEvent extends ParserEvent {
32
 public class ParserErrorEvent extends ParserEvent {
34
 
33
 
35
-    private final ParserError parserError;
34
+    private final Throwable throwable;
36
 
35
 
37
-    public ParserErrorEvent(final Parser parser, final Date date, final ParserError parserError) {
36
+    public ParserErrorEvent(final Parser parser, final Date date, final Throwable throwable) {
38
         super(parser, date);
37
         super(parser, date);
39
-        this.parserError = parserError;
38
+        this.throwable = throwable;
40
     }
39
     }
41
 
40
 
42
-    public ParserError getParserError() {
43
-        return parserError;
41
+    public Throwable getThrowable() {
42
+        return throwable;
44
     }
43
     }
45
 }
44
 }

Laddar…
Avbryt
Spara