Index: src/sas/sascalc/data_util/registry.py
===================================================================
--- src/sas/sascalc/data_util/registry.py	(revision 270c882bc870c7c9d75e62cd612c28f5cd4e9aaf)
+++ src/sas/sascalc/data_util/registry.py	(revision 7f75a3fc9b6c1be1b8f3ee54e1879b3fd8f5e4d6)
@@ -94,5 +94,7 @@
         Return the loader associated with the file type of path.
         
-        Raises ValueError if file type is not known.
+        :param path: Data file path
+        :raises ValueError: When no loaders are found for the file.
+        :return: List of available readers for the file extension
         """        
         # Find matching extensions
@@ -113,5 +115,4 @@
         if len(loaders) == 0:
             raise ValueError("Unknown file type for "+path)
-        # All done
         return loaders
 
@@ -120,8 +121,9 @@
         Call the loader for the file type of path.
 
-        Raises ValueError if no loader is available.
-        Raises KeyError if format is not available.
-        May raise a loader-defined exception if loader fails.        
+        :raise ValueError: if no loader is available.
+        :raise KeyError: if format is not available.
+        May raise a loader-defined exception if loader fails.
         """
+        loaders = []
         if format is None:
             try:
@@ -141,51 +143,2 @@
         # If we get here it is because all loaders failed
         raise NoKnownLoaderException(e.message)  # raise generic exception
-
-
-# TODO: Move this to the unit test folder
-def test():
-    reg = ExtensionRegistry()
-    class CxError(Exception): pass
-    def cx(file): return 'cx'
-    def new_cx(file): return 'new_cx'
-    def fail_cx(file): raise CxError
-    def cat(file): return 'cat'
-    def gunzip(file): return 'gunzip'
-    reg['.cx'] = cx
-    reg['.cx1'] = cx
-    reg['.cx'] = new_cx
-    reg['.gz'] = gunzip
-    reg['.cx.gz'] = new_cx
-    reg['.cx1.gz'] = fail_cx
-    reg['.cx1'] = fail_cx
-    reg['.cx2'] = fail_cx
-    reg['new_cx'] = new_cx
-
-    # Two loaders associated with .cx
-    assert reg.lookup('hello.cx') == [new_cx,cx]
-    # Make sure the last loader applies first
-    assert reg.load('hello.cx') == 'new_cx'
-    # Make sure the next loader applies if the first fails
-    assert reg.load('hello.cx1') == 'cx'
-    # Make sure the format override works
-    assert reg.load('hello.cx1',format='.cx.gz') == 'new_cx'
-    # Make sure the format override works
-    assert reg.load('hello.cx1',format='new_cx') == 'new_cx'
-    # Make sure the case of all loaders failing is correct
-    try:  reg.load('hello.cx2')
-    except CxError: pass # correct failure
-    else: raise AssertError,"Incorrect error on load failure"
-    # Make sure the case of no loaders fails correctly
-    try: reg.load('hello.missing')
-    except ValueError,msg:
-        assert str(msg)=="Unknown file type for hello.missing",\
-            'Message: <%s>'%(msg)
-    else: raise AssertError,"No error raised for missing extension"
-    assert reg.formats() == ['new_cx']
-    assert reg.extensions() == ['.cx','.cx.gz','.cx1','.cx1.gz','.cx2','.gz']
-    # make sure that it supports multiple '.' in filename
-    assert reg.load('hello.extra.cx1') == 'cx'
-    assert reg.load('hello.gz') == 'gunzip'
-    assert reg.load('hello.cx1.gz') == 'gunzip' # Since .cx1.gz fails
-
-if __name__ == "__main__": test()
Index: src/sas/sascalc/dataloader/loader.py
===================================================================
--- src/sas/sascalc/dataloader/loader.py	(revision 270c882bc870c7c9d75e62cd612c28f5cd4e9aaf)
+++ src/sas/sascalc/dataloader/loader.py	(revision 7f75a3fc9b6c1be1b8f3ee54e1879b3fd8f5e4d6)
@@ -70,6 +70,4 @@
         except NoKnownLoaderException as e:
             pass  # try the ASCII reader
-        except FileContentsException as e:
-            pass
         try:
             ascii_loader = ascii_reader.Reader()
@@ -86,8 +84,10 @@
             return cansas_nexus_loader.read(path)
         except FileContentsException:
+            logging.errors("No default loader can load the data")
             # No known reader available. Give up and throw an error
             msg = "\n\tUnknown data format: %s.\n\tThe file is not a " % path
-            msg += "known format that can be loaded by SasView."
-            raise NoKnownLoaderException(msg)
+            msg += "known format that can be loaded by SasView.\n"
+            msg += "Traceback:\n%s" % e.message
+            raise NoKnownLoaderException, msg
 
     def find_plugins(self, dir):
Index: src/sas/sascalc/dataloader/readers/ascii_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/ascii_reader.py	(revision 9a5097cd1c76689d1f997b85ba43d12a95d8f243)
+++ src/sas/sascalc/dataloader/readers/ascii_reader.py	(revision 7f75a3fc9b6c1be1b8f3ee54e1879b3fd8f5e4d6)
@@ -17,4 +17,5 @@
 import os
 from sas.sascalc.dataloader.data_info import Data1D
+from sas.sascalc.dataloader.loader_exceptions import FileContentsException
 
 # Check whether we have a converter available
@@ -173,16 +174,16 @@
                 if not is_data:
                     msg = "ascii_reader: x has no data"
-                    raise RuntimeError, msg
+                    raise FileContentsException, msg
                 # Sanity check
                 if has_error_dy == True and not len(ty) == len(tdy):
                     msg = "ascii_reader: y and dy have different length"
-                    raise RuntimeError, msg
+                    raise FileContentsException, msg
                 if has_error_dx == True and not len(tx) == len(tdx):
                     msg = "ascii_reader: y and dy have different length"
-                    raise RuntimeError, msg
+                    raise FileContentsException, msg
                 # If the data length is zero, consider this as
                 # though we were not able to read the file.
                 if len(tx) == 0:
-                    raise RuntimeError, "ascii_reader: could not load file"
+                    raise FileContentsException, "ascii_reader: could not load file"
 
                 #Let's re-order the data to make cal.
Index: src/sas/sascalc/dataloader/readers/cansas_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/cansas_reader.py	(revision 8434365120d0b226f06367f64c21b3bc835e1db5)
+++ src/sas/sascalc/dataloader/readers/cansas_reader.py	(revision 7f75a3fc9b6c1be1b8f3ee54e1879b3fd8f5e4d6)
@@ -29,4 +29,5 @@
 from sas.sascalc.dataloader.readers.xml_reader import XMLreader
 from sas.sascalc.dataloader.readers.cansas_constants import CansasConstants, CurrentLevel
+from sas.sascalc.dataloader.loader_exceptions import FileContentsException
 
 # The following 2 imports *ARE* used. Do not remove either.
@@ -534,5 +535,10 @@
 
         # Load in xml file and get the cansas version from the header
-        self.set_xml_file(xml_file)
+        from lxml import etree
+        try:
+            self.set_xml_file(xml_file)
+        except etree.XMLSyntaxError:
+            msg = "Cansas cannot load this file"
+            raise FileContentsException, msg
         self.cansas_version = self.xmlroot.get("version", "1.0")
 
Index: src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py
===================================================================
--- src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py	(revision d0764bfab02091109657cd6607dbfb337e7542f3)
+++ src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py	(revision 7f75a3fc9b6c1be1b8f3ee54e1879b3fd8f5e4d6)
@@ -13,4 +13,5 @@
     TransmissionSpectrum, Detector
 from sas.sascalc.dataloader.data_info import combine_data_info_with_plottable
+from sas.sascalc.dataloader.loader_exceptions import FileContentsException
 
 
@@ -75,5 +76,8 @@
             if extension in self.ext or self.allow_all:
                 # Load the data file
-                self.raw_data = h5py.File(filename, 'r')
+                try:
+                    self.raw_data = h5py.File(filename, 'r')
+                except Exception as e:
+                    raise FileContentsException, e
                 # Read in all child elements of top level SASroot
                 self.read_children(self.raw_data, [])
Index: src/sas/sascalc/dataloader/readers/xml_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/xml_reader.py	(revision a235f71571822c52f74fd1221fcd542805cf1277)
+++ src/sas/sascalc/dataloader/readers/xml_reader.py	(revision 7f75a3fc9b6c1be1b8f3ee54e1879b3fd8f5e4d6)
@@ -70,6 +70,6 @@
             self.xmldoc = etree.parse(self.xml, parser=PARSER)
             self.xmlroot = self.xmldoc.getroot()
-        except etree.XMLSyntaxError as xml_error:
-            logging.info(xml_error)
+        except etree.XMLSyntaxError:
+            raise
         except Exception:
             self.xml = None
Index: src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py
===================================================================
--- src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py	(revision 69400ece6331d3940134855e589a44b6b29307e0)
+++ src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py	(revision 7f75a3fc9b6c1be1b8f3ee54e1879b3fd8f5e4d6)
@@ -9,4 +9,5 @@
 
 from sas.sascalc.dataloader.loader import Loader
+from sas.sascalc.dataloader.loader_exceptions import NoKnownLoaderException
 from sas.sasgui.guiframe.plugin_base import PluginBase
 from sas.sasgui.guiframe.events import StatusEvent
@@ -39,4 +40,5 @@
 APPLICATION_WLIST = config.APPLICATION_WLIST
 
+
 class Plugin(PluginBase):
 
@@ -54,10 +56,8 @@
         """
         # menu for data files
-        menu_list = []
         data_file_hint = "load one or more data in the application"
         menu_list = [('&Load Data File(s)', data_file_hint, self.load_data)]
         gui_style = self.parent.get_style()
         style = gui_style & GUIFRAME.MULTIPLE_APPLICATIONS
-        style1 = gui_style & GUIFRAME.DATALOADER_ON
         if style == GUIFRAME.MULTIPLE_APPLICATIONS:
             # menu for data from folder
@@ -100,5 +100,4 @@
         self.get_data(file_list)
 
-
     def can_load_data(self):
         """
@@ -106,5 +105,4 @@
         """
         return True
-
 
     def _load_folder(self, event):
@@ -114,5 +112,5 @@
         path = None
         self._default_save_location = self.parent._default_save_location
-        if self._default_save_location == None:
+        if self._default_save_location is None:
             self._default_save_location = os.getcwd()
         dlg = wx.DirDialog(self.parent, "Choose a directory",
@@ -138,5 +136,6 @@
         """
         if error is not None or str(error).strip() != "":
-            dial = wx.MessageDialog(self.parent, str(error), 'Error Loading File',
+            dial = wx.MessageDialog(self.parent, str(error),
+                                    'Error Loading File',
                                     wx.OK | wx.ICON_EXCLAMATION)
             dial.ShowModal()
@@ -147,5 +146,6 @@
         """
         if os.path.isdir(path):
-            return [os.path.join(os.path.abspath(path), filename) for filename in os.listdir(path)]
+            return [os.path.join(os.path.abspath(path), filename) for filename
+                    in os.listdir(path)]
 
     def _process_data_and_errors(self, item, p_file, output, message):
@@ -220,9 +220,15 @@
                 info="info")
 
+            except NoKnownLoaderException as e:
+                logging.error(e.message)
+                self.load_update(output=None, message=e.message, info="warning")
+                self.load_complete(output=None,
+                                   message="Loading data failed!",
+                                   info="warning")
             except:
                 logging.error(sys.exc_value)
 
-                error_message = "The Data file you selected could not be loaded.\n"
-                error_message += "Make sure the content of your file"
+                error_message = "The Data file you selected could not be "
+                error_message += "loaded.\nMake sure the content of your file"
                 error_message += " is properly formatted.\n"
                 error_message += "When contacting the SasView team, mention the"
@@ -230,5 +236,6 @@
                 error_message += "Error: " + str(sys.exc_info()[1])
                 file_errors[basename] = [error_message]
-                self.load_update(output=output, message=error_message, info="warning")
+                self.load_update(output=output, message=error_message,
+                                 info="warning")
 
         if len(file_errors) > 0:
@@ -243,5 +250,5 @@
 
         self.load_complete(output=output, message="Loading data complete!",
-            info="info")
+                           info="info")
 
     def load_update(self, output=None, message="", info="warning"):
@@ -252,13 +259,10 @@
             wx.PostEvent(self.parent, StatusEvent(status=message, info=info,
                                                   type="progress"))
-    def load_complete(self, output, message="", error_message="", path=None,
-                      info="warning"):
-        """
-         post message to  status bar and return list of data
-        """
-        wx.PostEvent(self.parent, StatusEvent(status=message,
-                                              info=info,
+
+    def load_complete(self, output, message="", info="warning"):
+        """
+         post message to status bar and return list of data
+        """
+        wx.PostEvent(self.parent, StatusEvent(status=message, info=info,
                                               type="stop"))
-        # if error_message != "":
-        #    self.load_error(error_message)
         self.parent.add_data(data_list=output)
