You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a ticket to explore improvements to error handling within Formula. Currently, an error during evaluation can crash the whole feature which isn't great in production. While such issues aren't very common, I think we should provide APIs to contain the surface area of a crash.
The most common scenario is a duplicate key exception such as
val itemRenderModels = items.map { item ->
context.child(itemFormula, item)
}
One option to isolate such crashes is providing a special context.child API that has error handling built-in. This would be as such
// Returns a nullable render model instead of a real value in case of an error and fires `onError` callback.val item:ItemRenderModel?= context.child(itemFormula, item) { error ->Log.e("ItemPage", error) }
The text was updated successfully, but these errors were encountered:
How about we provide a custom lint rule that can be automatically integrated into Formula users' projects? Lint rule that detects key-less context.child() usage within the loop?
How about we provide a custom lint rule that can be automatically integrated into Formula users' projects? Lint rule that detects key-less context.child() usage within the loop?
I've been exploring lint rules a bit. Currently, I haven't figured out to have such a rule since the key() lives within the Formula. Also, it's hard to catch it if the loop is separated from context.child().
What
Creating a ticket to explore improvements to error handling within Formula. Currently, an error during evaluation can crash the whole feature which isn't great in production. While such issues aren't very common, I think we should provide APIs to contain the surface area of a crash.
The most common scenario is a duplicate key exception such as
One option to isolate such crashes is providing a special
context.child
API that has error handling built-in. This would be as suchThe text was updated successfully, but these errors were encountered: