<div dir="ltr"><div></div>I&#39;ll work on that next week..<br><br>Thanks!<br></div><br><div class="gmail_quote">On Wed, May 6, 2015 at 3:37 PM Marek Posolda &lt;<a href="mailto:mposolda@redhat.com">mposolda@redhat.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>+1 for JIRA. Also feel free to send PR
      as you already nail it down and you already send some PRs <span><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&#39;s done here:
      <a href="https://github.com/keycloak/keycloak/blob/master/services/src/main/java/org/keycloak/services/resources/admin/UsersResource.java#L771" target="_blank">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 href="https://github.com/keycloak/keycloak/blob/master/testsuite/integration/src/test/java/org/keycloak/testsuite/admin/UserTest.java#L49" target="_blank">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</div></div><div bgcolor="#FFFFFF" text="#000000"><div><br>
      <br>
      On 6.5.2015 19:31, Leonardo Loch Zanivan wrote:<br>
    </div></div><div bgcolor="#FFFFFF" text="#000000">
    <blockquote type="cite">
      <div dir="ltr">Unfortunatelly I think it&#39;s not possible right now.<br>
        <br>
        Admin client uses Admin REST API, which isn&#39;t handling errors
        correctly.<br>
        <br>
        If you try to reset a password using Admin interface you will
        get a generic error 500 saying &quot;Failed to reset user password&quot;.<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 href="mailto:b.hansmann@alphaapps.de" target="_blank">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 href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a><br>
          <a 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></fieldset>
      <br>
      <pre>_______________________________________________
keycloak-user mailing list
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
    </blockquote>
    <br>
  </div></blockquote></div>