diff --git a/goodtables/inspector.py b/goodtables/inspector.py index 1578c1068b..1a0459ebc8 100644 --- a/goodtables/inspector.py +++ b/goodtables/inspector.py @@ -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({ diff --git a/setup.py b/setup.py index 3558f07cca..fb172306ea 100644 --- a/setup.py +++ b/setup.py @@ -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',