1- """This module contains custom exceptions specific to the Harmony GDAL Adapter
2- service. These exceptions are intended to allow for clearer messages to the
3- end-user and easier debugging of expected errors that arise during an
4- invocation of the service.
1+ """Contains custom exceptions specific to the Harmony GDAL Adapter service.
2+
3+ These exceptions are intended to allow for clearer messages to the
4+ end-user and easier debugging of expected errors that arise during an
5+ invocation of the service.
56
67"""
78# noqa: D107
@@ -13,42 +14,29 @@ class HGAException(HarmonyException):
1314 """Base class for exceptions in the Harmony GDAL Adapter."""
1415
1516 def __init__ (self , message ):
16- super ().__init__ (message , 'nasa/harmony-gdal-adapter' )
17+ super ().__init__ (message )
1718
1819
1920class DownloadError (HGAException ):
20- """ This exception is raised when the Harmony GDAL Adapter cannot retrieve
21- input data.
21+ """Raised when the Harmony GDAL Adapter cannot retrieve input data."""
2222
23- """
2423 def __init__ (self , url , message ):
25- super ().__init__ (f' Could not download resource: { url } , { message } ' )
24+ super ().__init__ (f" Could not download resource: { url } , { message } " )
2625
2726
28- class UnknownFileFormatError (HGAException ):
29- """ This is raised when the input file format is one that cannot by
30- processed by the Harmony GDAL Adapter.
27+ class UnsupportedFileFormatError (HGAException ):
28+ """Raised when the input file format is cannot processed by the HGA."""
3129
32- """
3330 def __init__ (self , file_format ):
34- super ().__init__ ('Cannot process unrecognised file format: '
35- f'"{ file_format } "' )
31+ super ().__init__ (f'Cannot process unsupported file format: "{ file_format } "' )
3632
3733
3834class IncompatibleVariablesError (HGAException ):
39- """ This exception is raised when the dataset variables requested are not
40- compatible, i.e. they have different projections, geotransforms, sizes or
41- data types.
35+ """Raised when the dataset variables requested are not compatible.
4236
43- """
44- def __init__ (self , message ):
45- super ().__init__ (f'Incompatible variables: { message } ' )
46-
47-
48- class MultipleZippedNetCDF4FilesError (HGAException ):
49- """ This exception is raised when the input file supplied to HGA is a zip
50- file containing multiple NetCDF-4 files, as these cannot be aggregated.
37+ i.e. they have different projections, geotransforms, sizes or data types.
5138
5239 """
53- def __init__ (self , zip_file ):
54- super ().__init__ (f'Multiple NetCDF-4 files within input: { zip_file } .' )
40+
41+ def __init__ (self , message ):
42+ super ().__init__ (f"Incompatible variables: { message } " )
0 commit comments