question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

non-string populate.select throws uncatchable error:

See original GitHub issue

doing the following query: /User?populate={"path":"father", "select":["name", "age"]} (select is an array which is invalid format)

throws the following error: TypeError: Invalid select() argument. Must be string or object.

That error cannot be caught as it does not trigger options.onError neither the generic express app.use((req, res, next, error) => {}) middleware and it instantly kills the api server

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
smireacommented, Apr 13, 2016

here’s the stack trace:

EDIT: tried this with both 4.0.1 and the latest 3.* version

TypeError: Invalid select() argument. Must be string or object.
    at Query.select (__project__/node_modules/mquery/lib/mquery.js:1100:9)
    at Function.find (__project__/node_modules/mongoose/lib/model.js:1148:6)
    at populate (__project__/node_modules/mongoose/lib/model.js:2646:15)
    at _populate (__project__/node_modules/mongoose/lib/model.js:2470:5)
    at Function.Model.populate (__project__/node_modules/mongoose/lib/model.js:2427:5)
    at Immediate.cb (__project__/node_modules/mongoose/lib/query.js:1046:17)
    at Immediate._onImmediate (__project__/node_modules/mquery/lib/utils.js:137:16)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
0reactions
smireacommented, Apr 15, 2016

that looks good to me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncatchable ChuckNorrisException - java - Stack Overflow
It generates a verifier error: Exception in thread "main" java.lang.VerifyError: (class: TestThrow, method: ma\ in signature: ([Ljava ...
Read more >
MException - MathWorks
The MException object contains retrievable information about errors. MATLAB can throw either predefined exceptions or exceptions that you construct. Creation ...
Read more >
Error and Transaction Handling in SQL Server Part One
Introduction. This article is the first in a series of three about error and transaction handling in SQL Server.
Read more >
Why asynchronous exceptions are uncatchable with callbacks
Throwing an error asynchronously means that an error is thrown in the JavaScript code of an asynchronously executed callback. Throwing exception asynchronously.
Read more >
try...catch - JavaScript - MDN Web Docs - Mozilla
The code in the try block is executed first, and if it throws an exception, the code in the catch block will be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found