Join GitHub today
insertOrThrow to provide information about errors #355
Currently if an insert fails, the developer is left guessing as to why. If AA used insertOrThrow instead, there would be information about what happened. If an app is relying on the current relatively silent failure of inserts, it may crash after this update. The unfortunate thing is the exception thrown will be a runtime exception, so the compiler will not inform the dev that he needs to change anything. However, I would argue that it's worth the risk to give developers the information they need to produce correct apps. Currently I have a "debug save" version of the Model.save() method that doesn't actually do everything a save operation needs to do, but at least tells me what's going wrong with an insert. So if I find a problem with an insert I have to switch to the debug method, and then switch back after fixing it.