Browse Source

Fix parser errors.

pull/77/head
Greg Holmes 9 years ago
parent
commit
27c3b0677d

+ 3
- 6
common/src/com/dmdirc/parser/common/CallbackManager.java View File

@@ -26,8 +26,6 @@ import com.dmdirc.parser.events.ParserErrorEvent;
26 26
 import com.dmdirc.parser.events.ParserEvent;
27 27
 import com.dmdirc.parser.interfaces.Parser;
28 28
 
29
-import com.google.common.base.Throwables;
30
-
31 29
 import java.util.Date;
32 30
 
33 31
 import net.engio.mbassy.bus.MBassador;
@@ -89,10 +87,9 @@ public class CallbackManager extends MBassador<ParserEvent> {
89 87
             }
90 88
 
91 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 View File

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.parser.events;
24 24
 
25
-import com.dmdirc.parser.common.ParserError;
26 25
 import com.dmdirc.parser.interfaces.Parser;
27 26
 
28 27
 import java.util.Date;
@@ -32,14 +31,14 @@ import java.util.Date;
32 31
  */
33 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 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
 }

Loading…
Cancel
Save