Error When i copy items

Comments

5 comments

  • Andreas Garnæs

    Could you share the HTTP request (including body) which causes this error please?

    0
    Comment actions Permalink
  • kostas Loizidis

    public ClientResponse handle(final ClientRequest request) throws ClientHandlerException {
    Map<String, Object> effectiveProperties =
    new HashMap<String, Object>(properties);
    effectiveProperties.put(Client.class.getName(), this);
    effectiveProperties.putAll(request.getProperties());
    request.setProperties(effectiveProperties);

        final ClientResponse response = getHeadHandler().handle(request);
    
        response.getProperties().put(Client.class.getName(), this);
        return response;
    }
    

    The error is caused when the command final ClientResponse response = getHeadHandler().handle(request); is executed

    0
    Comment actions Permalink
  • kostas Loizidis
    public ClientResponse handle(ClientRequest cr)
            throws ClientHandlerException {
        try {
            ClientResponse response = getNext().handle(cr);
            if (response.getClientResponseStatus() == null
                    || response.getClientResponseStatus().getFamily() != Family.SUCCESSFUL) {
                Map<String, Object> errorData = response
                        .getEntity(new GenericType<Map<String, Object>>() {
                        });
    
                throw new APIApplicationException(
                        response.getClientResponseStatus(),
                        (String) errorData.get("error"),
                        (String) errorData.get("error_description"),
                        (Map<String, Object>) errorData.get("parameters"));
            } else {
                return response;
            }
        } catch (ClientHandlerException e) {
            throw new APITransportException(e.getCause());
        }
    }
    

    and throw APIApplicationException

    0
    Comment actions Permalink
  • Andreas Garnæs

    Thanks for sharing the code, but I was hoping you could share the HTTP request instead?

    0
    Comment actions Permalink
  • kostas Loizidis

    I don't know how to see the HTTP request, can you help me?

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk