diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py
index 89549dc..acdbeb3 100644
a
|
b
|
class Command(NoArgsCommand):
|
56 | 56 | if table_name_filter is not None and callable(table_name_filter): |
57 | 57 | if not table_name_filter(table_name): |
58 | 58 | continue |
59 | | yield 'class %s(models.Model):' % table2model(table_name) |
60 | | known_models.append(table2model(table_name)) |
61 | 59 | try: |
62 | 60 | relations = connection.introspection.get_relations(cursor, table_name) |
63 | 61 | except NotImplementedError: |
64 | 62 | relations = {} |
| 63 | except Exception as e: |
| 64 | yield "# Unable to inspect table %s" % table_name |
| 65 | yield "# The error was: %s" % e |
| 66 | continue |
65 | 67 | try: |
66 | 68 | indexes = connection.introspection.get_indexes(cursor, table_name) |
67 | 69 | except NotImplementedError: |
68 | 70 | indexes = {} |
| 71 | |
| 72 | yield 'class %s(models.Model):' % table2model(table_name) |
| 73 | known_models.append(table2model(table_name)) |
69 | 74 | used_column_names = [] # Holds column names used in the table so far |
70 | 75 | for i, row in enumerate(connection.introspection.get_table_description(cursor, table_name)): |
71 | 76 | comment_notes = [] # Holds Field notes, to be displayed in a Python comment. |