GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — datastore.get should handle entity not found better · Issue #10 · googleapis/google-cloud-node

datastore.get should handle entity not found better #10

New issue
Copy link
New issue
Copy link
Closed
#7852
Closed
datastore.get should handle entity not found better#10
#7852
Copy link
Assignees
rakyll
Labels
🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.
Milestone
Datastore Stable

Description

@proppy
proppy
opened on Jul 9, 2014
Issue body actions

Currently datastore.get would return `callback(null #error, undefined #key, undefined #entity), when entity is not found.

I think it would be more useful for the developer to provide a more explicit hint that the entity was not found (either through a dedicated error or some more structured result value).

As a reference the underlying RPC returns found and missing arrays.

Activity

Next
  1. rakyll commented on Jul 14, 2014

    @rakyll
    rakyll
    on Jul 14, 2014
    Contributor
    More actions

    I was thinking that current case (null #error, undefined #key, undefined #entity) would be explicit enough to say entity is not found. Returning a dedicated error would be another option but it gets annoying to handle errors on methods that work with multiple entities (getAll, saveAll, deleteAll).

  2. rakyll
    closed this as completedon Jul 14, 2014
  3. proppy commented on Jul 14, 2014

    @proppy
    proppy
    on Jul 14, 2014
    ContributorAuthor
    More actions

    maybe cb(null, null, null) would be more appropriate that cb(null, undefined, undefined).

    I'm not sure what nodejs developer expect for empty result, what seems weird in my case is that I can undefined as the result even if my lookup RPC is valid.

  4. rakyll commented on Jul 14, 2014

    @rakyll
    rakyll
    on Jul 14, 2014
    Contributor
    More actions

    I will pass null, null, null for consistency. Developer's way of interacting with this library is likely to be changed -- depending on which subset of JavaScript they like for sure.

    if(!entity) {
       // not found
    }
  5. rakyll
    reopened this on Jul 14, 2014
  6. rakyll commented on Jul 21, 2014

    @rakyll
    rakyll
    on Jul 21, 2014
    Contributor
    More actions

    I'm closing this issue. It's working as expected.

  7. rakyll
    closed this as completedon Jul 21, 2014
  8. jgeewax
    added
    api: datastoreIssues related to the Datastore API.
    on Feb 2, 2015
  9. jgeewax
    modified the milestones: This milestone has been deleted, Datastore Stable on Feb 2, 2015
  10. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨This issue needs some love.
    on Apr 6, 2020
  11. JustinBeckwith
    assigned
    rakyll
    on Feb 1, 2021
  12. 71 remaining items

  13. sofisl
    added a commit that references this issue on Feb 4, 2026

    Bump version to 0.7.0 (#10)

    ed2c742
  14. sofisl
    added a commit that references this issue on Feb 26, 2026

    Repo Migration (#10)

    493f7c4
  15. GautamSharda
    added a commit that references this issue on Mar 5, 2026

    Fix CI configuration glitches. (#10)

    a3eb035
  16. sofisl
    added 5 commits that reference this issue on Mar 5, 2026

    Merge pull request #10 from renovate-bot/renovate/pnpm-10.x

    fe9fbce

    chore: Jsdoc fresh migration (#48)

    6d29935

    chore: Retry request migration (#858)

    6dcb8a6

    Merge pull request #10 from stephenplusplus/functions

    015a66e

    fix: support uri and url options (#10)

    d1771d6
  17. codyoss
    added 2 commits that reference this issue on Mar 9, 2026

    chore(deps): lock file maintenance (#10)

    b6fb95b

    chore(deps): lock file maintenance (#10)

    00d1872
  18. GautamSharda
    added 2 commits that reference this issue on Mar 12, 2026

    chore(deps): lock file maintenance (#10)

    82076d8

    chore(deps): lock file maintenance (#10)

    795d27f
  19. GautamSharda
    added 2 commits that reference this issue on Mar 23, 2026

    Fix #10 Implement read-rows-acceptance-test (#22)

    This issue will close once commit 02dc37f is merged into the 'main' branch.
    02dc37f

    Fix #10 Implement read-rows-acceptance-test (#22)

    This issue will close once commit d8018c6 is merged into the 'main' branch.
    d8018c6
  20. shivanee-p
    added a commit that references this issue on Mar 27, 2026

    Fix #10 Implement read-rows-acceptance-test (#22)

    This issue will close once commit d34b917 is merged into the 'main' branch.
    d34b917
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rakyll
    rakyll

Labels

🚨This issue needs some love.api: datastoreIssues related to the Datastore API.triage meI really want to be triaged.

Type

No type

Projects

No projects

    Milestone

    • Datastore Stable

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.