yiisoft / yii2-redis

Yii 2 Redis extension.
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
452 stars 183 forks source link

Clarify that its a 'redis' DB error #169

Closed rhertogh closed 5 years ago

rhertogh commented 5 years ago
Q A
Is bugfix? no
New feature? no
Breaks BC? no
Tests pass? yes
Fixed issues -
rob006 commented 5 years ago

AFAIK it was intentionally left in this way to not disclose DB backend used by app.

rhertogh commented 5 years ago

@rob006 I don't think that would be an issue since that kind of exception would generally not be shown (in the web application a 'internal server error' is shown to the client).

The "problem" is that is currently looks like the default 'db' component causing the error. We use 4 different database systems and this error actually occurred when the application was trying do do some MySql logic but could not use the cache (for which we use redis). Therefore this error message is very ambiguous.

rob006 commented 5 years ago

The full message should be in error log:

https://github.com/yiisoft/yii2-redis/blob/e43a3b3aaae7db726c6f65af8453101012751c0d/src/Connection.php#L563

cebe commented 5 years ago
  1. as pointed out by @rob006 the full error message will be in the log
  2. this already throws a yii\redis\Exception so it is clear that this is about the redis db connection.
  3. that message may be shown to the users in some cases, so we keep information level low.

Thanks for the suggestion anyway!