Skip to main content

Is there a way to obtain the raw error info that was returned as part of a model operation such as save?

Currently, if you run a snippet On Error of a model save (or subscribe to models.saved) you can access arguments[0].messages to see the error messages that were collected.  The challenge here is that you only get the error message, not the row id, field name, model, etc.  

While my actual situation is more complex, here is a simple use case - When an error occurs saving records highlight the row(s) in error in red.  This comes in to play when the fields in error are in a drawer - most notably when the drawer is collapsed.

I can come up with some crazy solutions to obtain this information but it would require quite the hack job to pull off.  When errors are iterated underneath, the “message” portion is stored in ‘z.messages’ and then ‘z’ passed to the ‘models.saved’ event via publish and also to the deferred resolve.  As a quick solution, z could be modified to include ‘o’ which contains the full error message itself including message, fields, row, model, etc.  

Am I overlooking a current way to obtain this level of information short of getting super creative?

Thanks!

Skuid Team - Any input on this?


Barry~ 

Thanks for alerting us of this way to improve Skuid. The devs are aware of your idea and will consider it for a future release.

Thanks for helping us make Skuid better!
Karen


Reply