@@ -206,7 +206,7 @@ func ParseURL(redisURL string) (*Options, error) {
206206 case "unix" :
207207 return setupUnixConn (u )
208208 default :
209- return nil , fmt .Errorf ("invalid redis URL scheme: %s" , u .Scheme )
209+ return nil , fmt .Errorf ("redis: invalid URL scheme: %s" , u .Scheme )
210210 }
211211}
212212
@@ -216,7 +216,7 @@ func setupTCPConn(u *url.URL) (*Options, error) {
216216 o .Username , o .Password = getUserPassword (u )
217217
218218 if len (u .Query ()) > 0 {
219- return nil , errors .New ("no options supported" )
219+ return nil , errors .New ("redis: no options supported" )
220220 }
221221
222222 h , p , err := net .SplitHostPort (u .Host )
@@ -239,10 +239,10 @@ func setupTCPConn(u *url.URL) (*Options, error) {
239239 o .DB = 0
240240 case 1 :
241241 if o .DB , err = strconv .Atoi (f [0 ]); err != nil {
242- return nil , fmt .Errorf ("invalid redis database number: %q" , f [0 ])
242+ return nil , fmt .Errorf ("redis: invalid database number: %q" , f [0 ])
243243 }
244244 default :
245- return nil , fmt .Errorf ("invalid redis URL path: %s" , u .Path )
245+ return nil , fmt .Errorf ("redis: invalid URL path: %s" , u .Path )
246246 }
247247
248248 if u .Scheme == "rediss" {
@@ -258,7 +258,7 @@ func setupUnixConn(u *url.URL) (*Options, error) {
258258 }
259259
260260 if strings .TrimSpace (u .Path ) == "" { // path is required with unix connection
261- return nil , errors .New ("empty redis unix socket path" )
261+ return nil , errors .New ("redis: empty unix socket path" )
262262 }
263263 o .Addr = u .Path
264264
@@ -268,9 +268,10 @@ func setupUnixConn(u *url.URL) (*Options, error) {
268268 if dbStr == "" {
269269 return o , nil // if database is not set, connect to 0 db.
270270 }
271+
271272 db , err := strconv .Atoi (dbStr )
272273 if err != nil {
273- return nil , fmt .Errorf ("invalid reids database number: %s" , err )
274+ return nil , fmt .Errorf ("redis: invalid database number: %s" , err )
274275 }
275276 o .DB = db
276277
0 commit comments