Index: src/sas/sascalc/data_util/registry.py
===================================================================
--- src/sas/sascalc/data_util/registry.py	(revision b699768550de9d4b35b087234ec1d2a461922bab)
+++ src/sas/sascalc/data_util/registry.py	(revision 7f75a3fc9b6c1be1b8f3ee54e1879b3fd8f5e4d6)
@@ -7,5 +7,6 @@
 """
 
-import os.path
+from sas.sascalc.dataloader.loader_exceptions import NoKnownLoaderException
+
 
 class ExtensionRegistry(object):
@@ -61,12 +62,16 @@
     def __init__(self, **kw):
         self.loaders = {}
+
     def __setitem__(self, ext, loader):
         if ext not in self.loaders:
             self.loaders[ext] = []
         self.loaders[ext].insert(0,loader)
+
     def __getitem__(self, ext):
         return self.loaders[ext]
+
     def __contains__(self, ext):
         return ext in self.loaders
+
     def formats(self):
         """
@@ -76,4 +81,5 @@
         names.sort()
         return names
+
     def extensions(self):
         """
@@ -83,9 +89,12 @@
         exts.sort()
         return exts
+
     def lookup(self, path):
         """
         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
@@ -105,70 +114,31 @@
         # Raise an error if there are no matching extensions
         if len(loaders) == 0:
-            raise ValueError, "Unknown file type for "+path
-        # All done
+            raise ValueError("Unknown file type for "+path)
         return loaders
+
     def load(self, path, format=None):
         """
         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:
-            loaders = self.lookup(path)
+            try:
+                loaders = self.lookup(path)
+            except ValueError as e:
+                pass
         else:
-            loaders = self.loaders[format]
+            try:
+                loaders = self.loaders[format]
+            except KeyError as e:
+                pass
         for fn in loaders:
             try:
                 return fn(path)
-            except:
-                pass # give other loaders a chance to succeed
+            except Exception as e:
+                pass  # give other loaders a chance to succeed
         # If we get here it is because all loaders failed
-        raise # reraises last exception
-
-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()
+        raise NoKnownLoaderException(e.message)  # raise generic exception
