Catching and Display Registration Errors

Hello!
I’m new to Corvid, but not new to programming in general.

I’m trying to add a custom registration page to a site for a friend, and I’m finding it a bit unintuitive.

The code is currently really simple and looks like this:

   $w('#button9').onClick(e => {
        console.log("Clicked!",
          $w('#firstName').value,
          $w('#lastName').value
        )
        wixUsers.register(
          "test1@mailinator.com",
          $w('#password').value,
          {
            contactInfo: {
              "firstName": $w('#firstName').value,
              "lastName": $w('#lastName').value,
            }
          }).then(
            r => console.log("Success", r),
            err => console.log("Failure", err)
          )
    })

And when I run the code I see an error that looks like:

Wix code SDK error: The value of memberPassword parameter that is passed to the register method cannot be set to the value "7". Its length must be between 4 and 256.
Failure undefined

Which was surprising to me.
I know what it’s asking me to do, it’s asking me to type a better password into the box.
But the fact that it’s printing that issue into the console, and then not returning anything to the failure callback seems to almost defeat the purpose of having a failure callback.

Am I doing something wrong here, or do I actually have to build my own test that the password is between 4 and 256 characters first before sending it to the register method?
Is there no way to catch these special SDK errors?

What if there are other validation failures, like if the email is already registered? Should I expect those to come back as arguments to the failure callback so I can show them to the user, or do I need to find some way of testing those kinds of things too?

Ok, since there’s no reply here I did just put the logic into the code to check that it’s between 4 and 256 characters and if so send my own hard-coded error string through the error handling flow.
It’s not good, but it appears to be the best available to me.

Also, other errors like the one I mentioned about duplicate email addresses do appear to trigger the error handler of the promise with a string.
It’s not a great string, and it has an error code in it, but it’s better than nothing. So I’m showing that to the users if I have it.
Meh.