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

CachePoolException description ends in obscure {closure} #132

Open
SvetlinStaev opened this Issue Aug 13, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@SvetlinStaev

SvetlinStaev commented Aug 13, 2018

Hi,

I am using the cache library with the Redis adapter in a Symfony 4 application and I get the following exception intermittently:

Uncaught PHP Exception Cache\Adapter\Common\Exception\CachePoolException: "Exception thrown when executing "Cache\Adapter\Common{closure}". " at AbstractCachePool.php line 337 {"exception":"[object] (Cache\Adapter\Common\Exception\CachePoolException(code: 0): Exception thrown when executing "Cache\Adapter\Common\{closure}".

I looked at the AbstractCachePool at that line and I see the exception handling is wrapped in a method to centralize it but the location where the exception originates is hidden by the logger through closure rather than displaying the method it threw it. Is it possible to have that exception show the exact method it originates from?

@Korbeil

This comment has been minimized.

Show comment
Hide comment
@Korbeil

Korbeil Aug 14, 2018

Could you provide a sample code that reproduce the error ? Thanks !

Korbeil commented Aug 14, 2018

Could you provide a sample code that reproduce the error ? Thanks !

@SvetlinStaev

This comment has been minimized.

Show comment
Hide comment
@SvetlinStaev

SvetlinStaev Aug 14, 2018

This is the reason I posted this issue because I am unable to find out where the error originates from. It might be based on a Redis timeout, some network issue, a bad cache key or anything else but within the handleException method of the AbstractCachePool, there is a parameter $function which apparently passes the __FUNCTION_ in the caller but in PHP 7.2 it logs as {closure} rather than the function name. Will try to make a reproducer.

SvetlinStaev commented Aug 14, 2018

This is the reason I posted this issue because I am unable to find out where the error originates from. It might be based on a Redis timeout, some network issue, a bad cache key or anything else but within the handleException method of the AbstractCachePool, there is a parameter $function which apparently passes the __FUNCTION_ in the caller but in PHP 7.2 it logs as {closure} rather than the function name. Will try to make a reproducer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment