Table not found-error: A better approach is needed

Hi,

these days i got the following error, as described in this topic: anvil.tables.TableError: Table not found. Has it been deleted?

anvil.tables.TableError: Table not found. Has it been deleted?

The error occured while searching a table:

rows = app_tables.assets_hardware.search(muid=muid)

But this table was there, so there error message was wrong. It turned out that the cause was indeed a deleted table, but not the table that triggered the error message:

The hardware table contains a contact column (linked to the contacts table). The contact table contains a legal_form column (linked to the legal_forms table). I had deleted the legal_forms table but forgot to adjust the column in the contact table accordingly. That is what caused the error.

So, the error occurred two levels down, so to speak, but was passed up the chain.

Hence my suggestion: either formulate the error message more precisely, or, even better, display an error that points out the invalid reference.

3 Likes