Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respond with string doesn't work (sometimes) #114

Closed
boxxxie opened this issue Mar 20, 2015 · 4 comments
Closed

respond with string doesn't work (sometimes) #114

boxxxie opened this issue Mar 20, 2015 · 4 comments

Comments

@boxxxie
Copy link

boxxxie commented Mar 20, 2015

seneca.add({whatever:whatever}, function(err, respond){ respond(null, "success"); });

when i curl this, works fine.
when i do

seneca.act({whatever:whatever},function(err, resp){console.log(err, resp);});

i get print outs of null null

@rjrodger
Copy link
Collaborator

The only valid responses are objects. Anything else should trigger an error.

@rjrodger
Copy link
Collaborator

in master (will be 0.6.2), you can use option strict:{result:false} to allow non object results

@AdrianRossouw
Copy link
Contributor

this is kind of inconvenient for plugins, who aren't in control of what the seneca instances give them.
I also would kind of expect null or undefined to pass through at least.

I ended up having to wrap an elasticsearch.js callback in an extra function to deal with this.

@ghost
Copy link

ghost commented Nov 7, 2016

Seneca needs objects? - No problem, I thought.
In my task I have to respond with number value, so I wrote:
new Number(MY_VALUE);
but it anyway shows me an error message.
It's kind of strange behaviour since new Number is Object!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants