]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/Main.hs
Disable TSN.XML.MLBBoxScore in preparation for a release.
[dead/htsn-import.git] / src / Main.hs
index 59da41989696a0aabfe9aec446d5968c76d3f4d7..a47c669b3544871e0e6bc1413db767fba6bacf66 100644 (file)
@@ -45,6 +45,10 @@ import Network.Services.TSN.Report (
   report_info,
   report_error )
 import TSN.DbImport ( DbImport(..), ImportResult(..) )
+import TSN.Parse ( format_parse_error )
+import qualified TSN.XML.AutoRacingDriverList as AutoRacingDriverList (
+  dtd,
+  pickle_message )
 import qualified TSN.XML.AutoRacingResults as AutoRacingResults (
   dtd,
   pickle_message )
@@ -194,6 +198,9 @@ import_file cfg path = do
                    (unpickleDoc f xml)
 
           importer
+            | dtd == AutoRacingDriverList.dtd =
+                go AutoRacingDriverList.pickle_message
+
             | dtd == AutoRacingResults.dtd =
                 go AutoRacingResults.pickle_message
 
@@ -210,8 +217,7 @@ import_file cfg path = do
 
             | dtd == JFile.dtd = go JFile.pickle_message
 
-            | dtd == MLBEarlyLine.dtd =
-                go MLBEarlyLine.pickle_message
+            | dtd == MLBEarlyLine.dtd = go MLBEarlyLine.pickle_message
 
             | dtd == News.dtd =
                 -- Some of the newsxml docs are busted in predictable ways.
@@ -250,7 +256,7 @@ import_file cfg path = do
                 case either_m of
                   -- This might give us a slightly better error
                   -- message than the default 'errmsg'.
-                  Left err -> return $ ImportFailed err
+                  Left err -> return $ ImportFailed (format_parse_error err)
                   Right m     -> migrate_and_import m
 
             | dtd `elem` SportInfo.dtds = do
@@ -258,7 +264,7 @@ import_file cfg path = do
                 case either_m of
                   -- This might give us a slightly better error
                   -- message than the default 'errmsg'.
-                  Left err -> return $ ImportFailed err
+                  Left err -> return $ ImportFailed (format_parse_error err)
                   Right m     -> migrate_and_import m
 
             | otherwise = do