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

Silent errors should return false, not the defective Json #5

Open
geri777 opened this issue May 11, 2019 · 4 comments
Open

Silent errors should return false, not the defective Json #5

geri777 opened this issue May 11, 2019 · 4 comments

Comments

@geri777
Copy link

geri777 commented May 11, 2019

Thank you for this great and helpful library.

As described in the manual, the Fixer returns the original string if it can't be fixed.

(new Fixer)->silent()->fix('invalid');
// 'invalid'

This is maybe not the best way, because it is not possible to detect, if an error occured or not.
If any error happens silently, the function should return false.

@adhocore
Copy link
Owner

Sorry for late. Thanks for raising issue. I think it makes sense. Would be great if you could do quick PR :)
Just my thought, I think return false should not be default or at least should be configurable to achieve current working. Perhaps we add falseOnFailure() method to achieve your proposal? 😎

@ignacio-dev
Copy link

Was this ever fixed?

@adhocore
Copy link
Owner

no it seems

@adhocore
Copy link
Owner

i think thats by design, silent mode is for suppressing exception.

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

3 participants