Giter VIP home page Giter VIP logo

Comments (6)

JohannesHome avatar JohannesHome commented on July 17, 2024 1

As a follow up. I was able to reproduce the issue finally, and the delete was unrelated to my problem but a http error of 4xx group as this issue relates to.

We basically have a situation where we do a object.save(handler) call when nothing was changed in the object. In this case the client is doing a put with an empty object {} as no value has changed, and the server response with 400.

The main issue is, therefore, that save, merge and duplicate do not propagate the error to the handler, but instead try to access data. All these functions generate the same mentioned error in case the server response with anything else besides 200 containing an empty body.

This should be easy to fix.

from client-nodejs.

vasiabikeru avatar vasiabikeru commented on July 17, 2024 1

I have the same issue with the following:

console.log("initial: ", person["First Name"]); // output: undefined
person.set("First Name", firstName);
person.set("Last Name", lastName);
console.log("saved: ", person["First Name"]); // output: Bradley
person.save(function(err) { console.log("error", err); });

result is:

..../node_modules/pipedrive/lib/wrapCollectionItems.js:12
			var itemId = item.id || false;
			                  ^

TypeError: Cannot read property 'id' of null
    at doWrap (..../node_modules/pipedrive/lib/wrapCollectionItems.js:12:22)
    at ..../node_modules/pipedrive/lib/wrapCollectionItems.js:37:5

from client-nodejs.

tot-ra avatar tot-ra commented on July 17, 2024

@super-cache-money Did you get "Got deal" in console? I think you don't have deal with id 123, so you can't save it. Tried your code, works ok to me

from client-nodejs.

JohannesHome avatar JohannesHome commented on July 17, 2024

Hey, this issue occurs for me when doing pipedrive.Deals.get on a deleted deal. The item passed into wrapCollectionItems.js:12:21 is null, and hence has no item.id.

I would prefer an empty collection for this case, as it allows us to handle the not found case.

Can you fix this?

from client-nodejs.

super-cache-money avatar super-cache-money commented on July 17, 2024

from client-nodejs.

jonathanstokes avatar jonathanstokes commented on July 17, 2024

Still seeing the problem @JohannesHome mentions. When running within Node, hitting this kind of error in any call causes Node to crash, with no chance to intercept in a try/catch or callback.

We can't use this library because of this problem.

from client-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.