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

Can't catch thrown error #75

Closed
Zefau opened this issue Nov 18, 2018 · 3 comments
Closed

Can't catch thrown error #75

Zefau opened this issue Nov 18, 2018 · 3 comments

Comments

@Zefau
Copy link

Zefau commented Nov 18, 2018

Hi,

thanks for you library. I'm using it for an ioBroker module implementation (see https://github.com/Zefau/ioBroker.roomba).

In the course of my implementation I'm struggling to catch the error thrown in lib/v2/local.js at row 30:

throw e;

Try-catch-block fails catching the error, e.g. following code will NOT work:

try
{
	robot = new Roomba.Local(adapter.config.username, library.decode(settings.decode.key, adapter.config.password), adapter.config.ip); // username, password, ip
}
catch(err)
{
	adapter.log.debug(err.message);
	return;
}

My suggestion is to not throw the error and leave error-handling it to the end-point-implementation.

Thanks
Zefau

@koalazak
Copy link
Owner

koalazak commented Dec 3, 2018

I see the problem. But Im afraid of change that and break current implementations. Maybe we can merge this change with a major version update. But that require some addicional changes in readme and package.json.
PRs are welcome! :p
thanks

@Zefau
Copy link
Author

Zefau commented Dec 3, 2018

yeah I agree. Are you working on any changes at the moment?
I'm using dorita for an ioBroker implementation (see https://github.com/Zefau/ioBroker.roomba). In the course of that, I would like to support you in the development of this library if you need any help?

@koalazak
Copy link
Owner

koalazak commented Dec 4, 2018

thanks @Zefau
I have pending the cloud implementation for v2 firmwares
take a look if you want: #25

@koalazak koalazak closed this as completed Jan 8, 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

2 participants