Skip to content

Commit

Permalink
Rebased on granular tabulator exceptions (#115)
Browse files Browse the repository at this point in the history
* updated dependencies

* rebases on new tabulator exceptions
  • Loading branch information
roll authored Oct 27, 2016
1 parent 8005944 commit 8dc6797
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
21 changes: 8 additions & 13 deletions goodtables/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,17 @@ def __inspect_table(self, table, extra):
sample = stream.sample
except Exception as exception:
fatal_error = True
# https://github.com/frictionlessdata/goodtables-py/issues/115
if isinstance(exception, tabulator.exceptions.TabulatorException):
code = 'io-error'
message = 'IO error'
elif isinstance(exception, tabulator.exceptions.TabulatorException):
code = 'http-error'
message = 'HTTP error'
elif isinstance(exception, tabulator.exceptions.TabulatorException):
message = str(exception)
if isinstance(exception, tabulator.exceptions.SchemeError):
code = 'scheme-error'
message = 'Scheme error'
elif isinstance(exception, tabulator.exceptions.TabulatorException):
elif isinstance(exception, tabulator.exceptions.FormatError):
code = 'format-error'
message = 'Format error'
elif isinstance(exception, tabulator.exceptions.TabulatorException):
elif isinstance(exception, tabulator.exceptions.EncodingError):
code = 'encoding-error'
message = 'Encoding error'
elif isinstance(exception, tabulator.exceptions.IOError):
code = 'io-error'
elif isinstance(exception, tabulator.exceptions.HTTPError):
code = 'http-error'
else:
raise
errors.append({
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def read(*paths):
'six>=1.9,<2.0a',
'click>=6.6,<7.0a',
'requests>=2.10,<3.0a',
'tabulator>=0.7,<0.8a',
'jsontableschema>=0.7,<0.8a',
'datapackage>=0.8,<0.9a',
'tabulator>=0.10,<1.0a',
'jsontableschema>=0.7,<1.0a',
'datapackage>=0.8,<1.0a',
]
TESTS_REQUIRE = [
'pylama',
Expand Down

0 comments on commit 8dc6797

Please sign in to comment.