make exception developer-friendly. related to https://github.com/pyexcel-webwares/Flask-Excel/issues/31

This commit is contained in:
chfw 2018-04-15 23:03:13 +01:00
parent 8b53c1689b
commit 983bb7e013
2 changed files with 6 additions and 2 deletions

View File

@ -74,5 +74,7 @@ class DjangoBookWriter(BookWriter):
bulk_save=self._keywords.get('bulk_save', True)
)
else:
raise Exception("No django model found!")
raise Exception(
"Sheet: %s does not match any given models." % sheet_name +
"Please be aware of case sensitivity.")
return sheet_writer

View File

@ -89,5 +89,7 @@ class SQLBookWriter(BookWriter):
auto_commit=self.__auto_commit
)
else:
raise Exception("No suitable database adapter found!")
raise Exception(
"Sheet: %s does not match any given tables." % sheet_name +
"Please be aware of case sensitivity.")
return sheet_writer