timeout-decorator icon indicating copy to clipboard operation
timeout-decorator copied to clipboard

Doesn't use the built-in TimeoutError

Open terrdavis opened this issue 5 years ago • 4 comments

Why don't you use the built-in exception?

terrdavis avatar Jul 17 '18 16:07 terrdavis

The reason I think is that built-in TimeoutError is "Raised when a system function timed out at the system level.

Besides, using the same name TimeoutError seems error-prone (that's why I searched the issues for the name and found this one).

majiang avatar Apr 11 '21 03:04 majiang

It might be a good solution to use something like class TimeoutDecoratorError(TimeoutError): a class with a different name that inherits from the built-in exception.

bfontaine avatar Apr 24 '21 16:04 bfontaine

If you inherited you would say "a TimeoutDeoratorError is a TimeoutError" which is system level by built-in definition. We should rather just rename the TimeoutError to a non-confusing alternative.

majiang avatar Apr 24 '21 21:04 majiang

That’s true. requests uses Timeout to avoid the confusion with the built-in TimeoutError.

bfontaine avatar Apr 25 '21 08:04 bfontaine