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

Improve error reporting when passing invalid argument types for dialog API methods #4887

Merged
merged 2 commits into from
Mar 30, 2016

Conversation

sbekrin
Copy link

@sbekrin sbekrin commented Mar 23, 2016

Currently next code:

dialog.showMessageBox({
    type: 'warning',
    buttons: [ 'Cancel' ],
    message: 'Foo',
    detail: {}
});

Will produce this error, which does not make much sense:

Uncaught Error: Could not call remote function ``. Check that the function signature is correct. Underlying error: Error processing argument at index 7, conversion failure from ...

This PR adds type checks and better error reporting.

@sbekrin sbekrin changed the title Improve error reporting when using invalid argument types for dialog API methods Improve error reporting when passing invalid argument types for dialog API methods Mar 23, 2016
@kevinsawicki
Copy link
Contributor

How would feel about tweaking the error messages slightly?

Something like: Title must be a string instead of Title need to be string?

@kevinsawicki
Copy link
Contributor

Thanks for improving these errors 👍 🚢

@kevinsawicki kevinsawicki merged commit 8bcede8 into electron:master Mar 30, 2016
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.

None yet

2 participants