code: public static String exceptionMessage(Credentials input, denominator.Provider provider) {
      StringBuilder msg = new StringBuilder();
      if (input == null || input == AnonymousCredentials.INSTANCE) {
        msg.append("no credentials supplied. ");
      } else {
        msg.append("incorrect credentials supplied. ");
      }
      msg.append(provider.name()).append(" requires ");
  
      Map<String, Collection<String>>
          credentialTypeToParameterNames =
          provider.credentialTypeToParameterNames();
      if (credentialTypeToParameterNames.size() == 1) {
        msg.append(join(',', credentialTypeToParameterNames.values().iterator().next().toArray()));
      } else {
        msg.append("one of the following forms: when type is ");
        for (Entry<String, Collection<String>> entry : credentialTypeToParameterNames.entrySet()) {
          msg.append(entry.getKey()).append(": ").append(join(',', entry.getValue().toArray()))
              .append("; ");
        }
        msg.trimToSize();
        msg.setLength(msg.length() - 2);// remove last '; '
      }
      return msg.toString();
    }
docs: Use this method to generate a consistent error message when the credentials supplied are not
  valid for the provider. Typically, this will be the message of an {@code
  IllegalArgumentException}
  
  @param input    nullable credentials you know are invalid
  @param provider provider they are invalid for