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

I need error msg #968

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

I need error msg #968

wants to merge 2 commits into from

Conversation

tamasvar
Copy link

I still need the msg.payload when there is an error, not only when everything is going well.

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run grunt to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

I still need the msg.payload when there is an error, not only when everything is going well.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 11, 2023

CLA Not Signed

@dceejay
Copy link
Member

dceejay commented Jan 17, 2023

I can understand why you may want it - but for naive users I think it is better to not send anything when there is an error, rather than send a (normally) empty [] response that would look like a valid response unless you check for an error. So I'm not (yet) convinced that this a change we should make. You could also use the error to create a dummy payload [] if you need to forward it on - but yes your fix would do that for you.

@shaqaruden
Copy link
Contributor

I can understand why you may want it - but for naive users I think it is better to not send anything when there is an error, rather than send a (normally) empty [] response that would look like a valid response unless you check for an error. So I'm not (yet) convinced that this a change we should make. You could also use the error to create a dummy payload [] if you need to forward it on - but yes your fix would do that for you.

I agree that it shouldn't send an error but I do think it should throw an error

I thought that even if there is an error, send a message.
@jonbdk
Copy link

jonbdk commented Apr 22, 2024

I would suggest a slightly different approach - with largely the same result.
Create a secondary output, which is used in case of error.
In 64-mysql.html change:
outputs:1,
to
outputs:2,
In 68-mysql.js
After the line (147)
node.error(err, msg);
add line:
send([null, { query: msg.topic, payload: 'ERROR', error: err }]);

You could event remove the node.error() - if you wanted it to be less chatty

I created a PR: #1062

@jonbdk jonbdk mentioned this pull request Apr 22, 2024
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

Successfully merging this pull request may close these issues.

4 participants