@JNBarchan QStandardItemModel uses QVariant as data. You can set and get any QVariant compatible data. There's no reason to have error handling because the class isn't meant for error prone data. See QStandardItem and QVariant for details. QSqlTableModel.lastError is specific to SQL.
If you want to, you can implement your own runtime error handling in your model. QStandardItemModel is mostly meant for simple cases, but you can subclass it as the docs say: "Reimplement data() and setData() if you want to perform custom handling of data queries and/or control how an item's data is represented." Just add your own error handling mechanism. Or inherit from QAbstractItemModel if performance and low-level details are important. QSqlTableModel does that, adding SQL specific things, one of which is SQL error handling.