Skip to content

Commit 663b1cf

Browse files
committed
🔥 remove duplicated error handler
1 parent ca1489e commit 663b1cf

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

moban/plugins.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,13 @@ def get_data(self, file_name):
195195
raise exceptions.IncorrectDataInput
196196
utils.merge(data, self.__cached_environ_variables)
197197
return data
198-
except IOError as exception:
198+
except (IOError, exceptions.IncorrectDataInput) as exception:
199199
# If data file doesn't exist:
200200
# 1. Alert the user of their (potential) mistake
201201
# 2. Attempt to use environment vars as data
202202
reporter.report_warning_message(str(exception))
203203
reporter.report_using_env_vars()
204204
return self.__cached_environ_variables
205-
except exceptions.IncorrectDataInput as exception2:
206-
# If data file is not in the right format
207-
# do the same as above
208-
reporter.report_warning_message(str(exception2))
209-
reporter.report_using_env_vars()
210-
return self.__cached_environ_variables
211205

212206

213207
def make_sure_all_pkg_are_loaded():

0 commit comments

Comments
 (0)