File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- __version__ = '0.0.3 '
15+ __version__ = '0.0.4 '
Original file line number Diff line number Diff line change @@ -35,11 +35,15 @@ def create_writer(
3535 to correctly instantiate it.
3636
3737 Args:
38- writer_option: Type of writer.
39- kwargs: Any possible arguments needed o instantiate writer.
38+ writer_option: Type of writer.
39+ kwargs: Any possible arguments needed o instantiate writer.
4040
4141 Returns:
42- Concrete instantiated writer.
42+ Concrete instantiated writer.
43+
44+ Raises:
45+ ImportError: When writer specific library is not installed.
46+ GarfIoError: When incorrect writer option is specified.
4347 """
4448 writers = entry_points (group = 'garf_writer' )
4549 found_writers = {}
@@ -51,6 +55,10 @@ def create_writer(
5155 found_writers [writer .name ] = getattr (writer_module , name )
5256 except ModuleNotFoundError :
5357 continue
58+ except ImportError as e :
59+ if writer_option == writer .name :
60+ raise e
61+ continue
5462 if concrete_writer := found_writers .get (writer_option ):
5563 return concrete_writer (** kwargs )
5664 raise GarfIoWriterError (f'{ writer_option } is unknown writer type!' )
You can’t perform that action at this time.
0 commit comments