phpseclib
phpseclib copied to clipboard
replace user_error's with Exceptions
For the 2.0 / php5 branch
As I've explained elsewhere: This might not be as simple as just replacing user_error() with throw Exception(). Appropriate exception classes/types should be introduced/used, allowing exceptions to be used more appropriately. This requires at least some thinking.
I agree, it will take some doing to do properly... There is definitely some low hanging fruit though, and some user errors that really should just be logs instead of errors. Perhaps if we were to first address the logging situation, this would become much easier, specifically - implement a psr-3 logging interface and funnel everything through it, then we just need to throw exceptions for true show stoppers.
Thoughts?
As I've explained elsewhere: This might not be as simple as just replacing user_error() with throw Exception(). Appropriate exception classes/types should be introduced/used, allowing exceptions to be used more appropriately. This requires at least some thinking.
For sure.
There is definitely some low hanging fruit though, and some user errors that really should just be logs instead of errors.
Which errors do you think ought to show up in logs instead? It's hard to agree or disagree without specifics.
any news?
any news?
The 3.0 and master branches replace user_errors with exceptions. I'll tag 3.0.0 when I finish up with the documentation revamp.