How to clear model.fetch() Errors [SOLVED]

edited February 6 in Enyo 2.7
Hi Enyo Folks,
I finally have some time again to get back to my old Enyo / Loopback project and I'm having a heck of a time with handling login errors. I am calling mftLbUserLoginModel.fetch(); from my Login Button. It works great if I get a clean response, but if I use a bogus password and get a 401 back, I can't re-attempt the login. I tried logging isError() for the model in the ajax.error handler, but the console shows it clean:mftLbUserLoginModel.isError() = false. I have also tried mftLbUserLoginModel.clearError() in the error handler, but that seems to have no effect either.
I hope this is something obvious that I'm missing and perhaps someone can steer me in the right direction.

Comments

  • Whoopsi!
    I had clogged up the ajax.error handler with so many console.log() calls that I didn't realize I was trying that mftLbUserLoginModel.clearError() before the opts.error(inError); - once I moved the .clearError() after the opts.error(inError); it worked as expected.
    -Maybe this will help another newb...
Sign In or Register to comment.