How to obtain raw error info returned from model operations (e.g. save)

  • 1
  • Problem
  • Updated 2 years ago
  • Acknowledged
  • (Edited)
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!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Skuid Team - Any input on this?
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
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