Browse Source

Better error descriptions.

Dmitry Chestnykh 14 years ago
parent
commit
34dcf8d144
2 changed files with 2 additions and 2 deletions
  1. 1 1
      captcha.go
  2. 1 1
      random.go

+ 1 - 1
captcha.go

@@ -58,7 +58,7 @@ const (
 )
 
 var (
-	ErrNotFound = os.NewError("captcha with the given id not found")
+	ErrNotFound = os.NewError("captcha: id not found")
 	// globalStore is a shared storage for captchas, generated by New function.
 	globalStore = NewMemoryStore(CollectNum, Expiration)
 )

+ 1 - 1
random.go

@@ -32,7 +32,7 @@ func RandomDigits(length int) (b []byte) {
 func randomBytes(length int) (b []byte) {
 	b = make([]byte, length)
 	if _, err := io.ReadFull(crand.Reader, b); err != nil {
-		panic("error reading random source: " + err.String())
+		panic("captcha: error reading random source: " + err.String())
 	}
 	return
 }