[Tmf][Ctf] Add descriptive fail to import messages.
[deliverable/tracecompass.git] / org.eclipse.linuxtools.ctf.core / src / org / eclipse / linuxtools / ctf / core / trace / Metadata.java
index 92e0129139576c8b211071b13da9628a30bdf792..27ca681d63be828d4c3e67c81b0d9a99f2ee895a 100644 (file)
@@ -27,6 +27,7 @@ import java.util.UUID;
 
 import org.antlr.runtime.ANTLRReaderStream;
 import org.antlr.runtime.CommonTokenStream;
+import org.antlr.runtime.MismatchedTokenException;
 import org.antlr.runtime.RecognitionException;
 import org.antlr.runtime.tree.CommonTree;
 import org.eclipse.linuxtools.ctf.parser.CTFLexer;
@@ -174,11 +175,9 @@ public class Metadata {
             tempException = new CTFReaderException(e);
         } catch (ParseException e) {
             tempException = new CTFReaderException(e);
+        } catch (MismatchedTokenException e) {
+            tempException = new CTFReaderException(e);
         } catch (RecognitionException e) {
-            /*
-             * We don't want to expose this ANTLR-specific exception type to the
-             * outside..
-             */
             tempException = new CTFReaderException(e);
         }
 
@@ -250,8 +249,7 @@ public class Metadata {
         try {
             metadataFileChannel.read(magicByteBuffer, 0);
         } catch (IOException e) {
-            throw new CTFReaderException(
-                    "Unable to read metadata file channel."); //$NON-NLS-1$
+            throw new CTFReaderException("Unable to read metadata file channel."); //$NON-NLS-1$
         }
 
         /* Get the first int from the file */
@@ -353,8 +351,7 @@ public class Metadata {
         try {
             metadataFileChannel.read(payloadByteBuffer);
         } catch (IOException e) {
-            throw new CTFReaderException(
-                    "Error reading metadata packet payload."); //$NON-NLS-1$
+            throw new CTFReaderException("Error reading metadata packet payload."); //$NON-NLS-1$
         }
         payloadByteBuffer.rewind();
 
This page took 0.024036 seconds and 5 git commands to generate.