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

Handle.Call() does not return error when a command fails #34

Closed
ArnoSen opened this issue Oct 16, 2019 · 1 comment
Closed

Handle.Call() does not return error when a command fails #34

ArnoSen opened this issue Oct 16, 2019 · 1 comment

Comments

@ArnoSen
Copy link

ArnoSen commented Oct 16, 2019

As described in the comments for Handle.Call(), it only errors out when
error if handle is invalid, or problem encountered during sending or receiveing. .

However, when a command fails because e.g. a syntax error or an object that is not there, Handle.Call() will not error out. After Handle.Call() has been called, it is not possible anymore to get the error related to a failed command.

I see a couple of possible solutions:
1 Handle.Call() will return an error, next to communication errors, if any of the commands failed.
2 Handle.Call() will return an array of errors so the developer can find out which command failed more easily.

Changing the Handle.Call can break the API, so I would suggest to implement new methods:

  • CallWithCommandError() (error): this will return an error when a command failed.
  • CallWithCommandErrors(error, []error): this will return the current error object together with a slice of errors one for each command.

What do you think?

@ArnoSen
Copy link
Author

ArnoSen commented Oct 16, 2019

Probably this was caused by something in my code. I am closing this issue

@ArnoSen ArnoSen closed this as completed Oct 16, 2019
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

1 participant