-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add a filter option #18
Comments
@sindresorhus interested in working on this if you are open to it. General idea is:
Anything I'm missing or additional features that you think are important? That seems similar to what was done here, so I wanted to double check that I'm not repeating a mistake. |
I think it should accept a RegExp or a function. If a function, the function would receive the error and return true/false for whether to keep it. |
I will never understand how opensource / pull requests is a thing that works. The time you guys spend on discussing this stupid little issue, the time you spend reviewing, rejecting and commenting the pull requests.. in all those hours and days spend, couldn't you just have implemented it yourself? |
@Coding-Kiwi Yes, it usually would have been faster for me to implement stuff myself, but, not everything is worth implementing. Whether someone is willing to do a pull request for a feature is a good indication of whether such feature is worth adding. Also, discussing the optimal solution is valuable. I often don't think of the best solution myself as I don't know all the requirements. I do implement important things myself when I have the time. For example, in this situation. I have no need for this feature, but I'm willing to have it added if someone cares enough to do a good pull request. |
accepting a function makes sense, good suggestion. i now wonder if we should make it only a function to keep the interface simple. caller can wrap the regex into a function if they want to. i will start working on it, and you can comment in the PR if you agree. easy modification either way. |
@sindresorhus pr is here: #25 |
If anyone wants to work on this, see the initial attempt in #25. |
It would be great if we had a configurable filter function that, if defined in the options, gets called BEFORE the options.logger and showMessageBox function get called and returns true or false to decide if the error should pass or not.
That way one could filter out error messages like ERR_CONNECTION_REFUSED that are not catchable
The text was updated successfully, but these errors were encountered: