<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">+1 for JIRA. Also feel free to send PR
      as you already nail it down and you already send some PRs <span
        class="moz-smiley-s1"><span> :-) </span></span> <br>
      <br>
      By the way, Thanks for them.<br>
      <br>
      It seems that generally we should improve on handling errors from
      admin REST endpoints. Ideally you can handle the error response
      similarly like it's done here:
      <a class="moz-txt-link-freetext" href="https://github.com/keycloak/keycloak/blob/master/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java#L771">https://github.com/keycloak/keycloak/blob/master/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java#L771</a>
      . Then on admin-client side, you can catch ClientErrorException
      and see the error message for example like done here:
<a class="moz-txt-link-freetext" href="https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/java/org/keycloak/testsuite/admin/UserTest.java#L49">https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/java/org/keycloak/testsuite/admin/UserTest.java#L49</a><br>
      <br>
      Thanks,<br>
      Marek<br>
      <br>
      On 6.5.2015 19:31, Leonardo Loch Zanivan wrote:<br>
    </div>
    <blockquote
cite="mid:CA+sftsACxFr7FXafbF-qOkzj18D+r9Mf7egyNx1qGu6fmdLTyw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Unfortunatelly I think it's not possible right now.<br>
        <br>
        Admin client uses Admin REST API, which isn't handling errors
        correctly.<br>
        <br>
        If you try to reset a password using Admin interface you will
        get a generic error 500 saying "Failed to reset user password".<br>
        <br>
        In the server the stacktrace shows:<br>
        Caused by: org.jboss.resteasy.spi.UnhandledException:
        org.keycloak.models.ModelException:
        invalidPasswordMinLengthMessage<br>
        <br>
        We could fill a JIRA to handle ModelException using JAX-RS
        exception handlers, so the response will have the correct error
        and we could show a better error message.</div>
      <br>
      <div class="gmail_quote">On Wed, May 6, 2015 at 2:10 PM Benjamin
        Hansmann [alphaApps] &lt;<a moz-do-not-send="true"
          href="mailto:b.hansmann@alphaapps.de">b.hansmann@alphaapps.de</a>&gt;
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">Is one able
          to get an error message from the resetPassword method of<br>
          admin-client if it somehow failed to reset the password, like
          when the<br>
          password is too short or does not comply with the password
          policy?<br>
          <br>
          It throws an InternalServerErrorException in that case. On the
          server<br>
          side there seems to be a ModelException:<br>
          invalidPasswordMinLengthMessage. That information is lost...<br>
          <br>
          <br>
          _______________________________________________<br>
          keycloak-user mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
          <a moz-do-not-send="true"
            href="https://lists.jboss.org/mailman/listinfo/keycloak-user"
            target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
    </blockquote>
    <br>
  </body>
</html>