mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 16:50:18 +01:00
fix error strings
This commit is contained in:
parent
fa0ec06e36
commit
65762936a4
@ -22,7 +22,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// ErrDatabaseNotExists indicates that the database does not exist.
|
// ErrDatabaseNotExists indicates that the database does not exist.
|
||||||
var ErrDatabaseNotExists = errors.New("Database does not exists.")
|
var ErrDatabaseNotExists = errors.New("database does not exists")
|
||||||
|
|
||||||
const blocksPerTx = 128 // Number of blocks copied in a transaction.
|
const blocksPerTx = 128 // Number of blocks copied in a transaction.
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ func (rp *RedisParser) bulkString(line []byte) bool {
|
|||||||
default:
|
default:
|
||||||
if i > rp.maxBulkStringSize { // prevent denial of service.
|
if i > rp.maxBulkStringSize { // prevent denial of service.
|
||||||
return rp.consumeError(
|
return rp.consumeError(
|
||||||
fmt.Errorf("Bulk string too large (%d bytes).\n", i))
|
fmt.Errorf("bulk string too large (%d bytes)", i))
|
||||||
}
|
}
|
||||||
data := make([]byte, i)
|
data := make([]byte, i)
|
||||||
for rest := i; rest > 0; {
|
for rest := i; rest > 0; {
|
||||||
|
@ -18,9 +18,9 @@ import (
|
|||||||
|
|
||||||
// Error returned if a Producer has run to its end.
|
// Error returned if a Producer has run to its end.
|
||||||
var (
|
var (
|
||||||
ErrNoMoreBlocks = errors.New("No more blocks.")
|
ErrNoMoreBlocks = errors.New("no more blocks")
|
||||||
ErrMapContentSizeMismatch = errors.New("Content size does not match.")
|
ErrMapContentSizeMismatch = errors.New("content size does not match")
|
||||||
ErrBlockTruncated = errors.New("Block is truncated.")
|
ErrBlockTruncated = errors.New("block is truncated")
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -83,7 +83,7 @@ func tmpName(tmpl string) (string, error) {
|
|||||||
rrand = reseed()
|
rrand = reseed()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "", errors.New("Cannot create temp name")
|
return "", errors.New("cannot create temp name")
|
||||||
}
|
}
|
||||||
|
|
||||||
func SaveAsPNGAtomic(path string, img image.Image) (err error) {
|
func SaveAsPNGAtomic(path string, img image.Image) (err error) {
|
||||||
|
@ -107,7 +107,7 @@ func isError(line []byte) error {
|
|||||||
// parseSize is a cheaper replacement for fmt.Sscanf(string(line), "$%d\r\n", &size).
|
// parseSize is a cheaper replacement for fmt.Sscanf(string(line), "$%d\r\n", &size).
|
||||||
func parseSize(line []byte) (int, error) {
|
func parseSize(line []byte) (int, error) {
|
||||||
if len(line) < 1 || line[0] != '$' {
|
if len(line) < 1 || line[0] != '$' {
|
||||||
return 0, errors.New("Missing '$' at begin of line")
|
return 0, errors.New("missing '$' at begin of line")
|
||||||
}
|
}
|
||||||
line = bytes.TrimFunc(line[1:], unicode.IsSpace)
|
line = bytes.TrimFunc(line[1:], unicode.IsSpace)
|
||||||
v, err := strconv.ParseInt(string(line), 10, 0)
|
v, err := strconv.ParseInt(string(line), 10, 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user