phpseclib icon indicating copy to clipboard operation
phpseclib copied to clipboard

replace user_error's with Exceptions

Open terrafrost opened this issue 10 years ago • 5 comments

For the 2.0 / php5 branch

terrafrost avatar Dec 29 '14 16:12 terrafrost

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.

bantu avatar Jan 06 '15 20:01 bantu

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?

cnelissen avatar Jan 07 '15 05:01 cnelissen

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.

terrafrost avatar Jan 07 '15 20:01 terrafrost

any news?

PaoJiao avatar Jul 10 '20 15:07 PaoJiao

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.

terrafrost avatar Jul 12 '20 19:07 terrafrost