public static String getDefaultReasonPhrase ( char errorCode ) { switch ( errorCode ) { case BAD_REQUEST : return "(Bad Request): The request was malformed. The client should not " + "retry the request without modification from the previous attempt." ; case UNAUTHORIZED : return "(Unauthorized): The Binding Request did not contain a MESSAGE-" + "INTEGRITY attribute." ; case UNKNOWN_ATTRIBUTE : return "(Unknown Attribute): The server did not understand a mandatory " + "attribute in the request." ; case STALE_CREDENTIALS : return "(Stale Credentials): The Binding Request did contain a MESSAGE-" + "INTEGRITY attribute, but it used a shared secret that has " + "expired. The client should obtain a new shared secret and try" + "again" ; case INTEGRITY_CHECK_FAILURE : return "(Integrity Check Failure): The Binding Request contained a " + "MESSAGE-INTEGRITY attribute, but the HMAC failed verification. " + "This could be a sign of a potential attack, or client " + "implementation error." ; case MISSING_USERNAME : return "(Missing Username): The Binding Request contained a MESSAGE-" + "INTEGRITY attribute, but not a USERNAME attribute. Both must be" + "present for integrity checks." ; case USE_TLS : return "(Use TLS): The Shared Secret request has to be sent over TLS, but" + "was not received over TLS." ; case SERVER_ERROR : return "(Server Error): The server has suffered a temporary error. The" + "client should try again." ; case GLOBAL_FAILURE : return "(Global Failure:) The server is refusing to fulfill the request." + "The client should not retry." ; default : return "Unknown Error" ; } }
Returns a default reason phrase corresponding to the specified error code as described by rfc 3489 .