source: sasview/src/sas/sascalc/dataloader/loader_exceptions.py @ da8bb53

ESS_GUIESS_GUI_CategroyManagerESS_GUI_PrESS_GUI_better_batchESS_GUI_corfESS_GUI_model_editorESS_GUI_py2_OLDESS_GUI_sum_editorSVCC-1SasView-664costrafo411ticket-1094-headlessticket-818ticket-976ticket885ticket885bunittest-saveloadwin64bit_conda_vm
Last change on this file since da8bb53 was da8bb53, checked in by krzywon, 12 months ago

Added a 4th data loader exception for generic readers that cannot open file.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1"""
2Exceptions specific to loading data.
3"""
4
5
6class NoKnownLoaderException(Exception):
7    """
8    Exception for files with no associated reader based on the file
9    extension of the loaded file. This exception should only be thrown by
10    loader.py.
11    """
12    def __init__(self, e):
13        self.message = e
14
15
16class FileContentsException(Exception):
17    """
18    Exception for files with an associated reader, but with no loadable data.
19    This is useful for catching loader or file format issues.
20    """
21    def __init__(self, e):
22        self.message = e
23
24
25class DefaultReaderException(Exception):
26    """
27    Exception for files with no associated reader. This should be thrown by
28    default readers only to tell Loader to try the next reader.
29    """
30    def __init__(self, e):
31        self.message = e
32
33
34class DataReaderException(Exception):
35    """
36    Exception for files that were able to mostly load, but had minor issues
37    along the way.
38    Any exceptions of this type should be put into the datainfo.errors
39    """
40    def __init__(self, e):
41        self.message = e
Note: See TracBrowser for help on using the repository browser.