File: errors.go

package info (click to toggle)
golang-github-tideland-golib 4.24.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,144 kB
  • sloc: makefile: 4
file content (51 lines) | stat: -rw-r--r-- 1,251 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Tideland Go Library - Cache
//
// Copyright (C) 2009-2017 Frank Mueller / Tideland / Oldenburg / Germany
//
// All rights reserved. Use of this source code is governed
// by the new BSD license.

package cache

//--------------------
// IMPORTS
//--------------------

import (
	"github.com/tideland/golib/errors"
)

//--------------------
// CONSTANTS
//--------------------

// Errors of the Cache.
const (
	ErrSettingOptions = iota + 1
	ErrIllegalCache
	ErrNoLoader
	ErrLoading
	ErrCheckOutdated
	ErrDiscard
	ErrDiscardedWhileLoading
	ErrTimeout
	ErrFileLoading
	ErrFileSize
	ErrFileChecking
)

var errorMessages = errors.Messages{
	ErrSettingOptions:        "cannot set option",
	ErrIllegalCache:          "illegal cache type for option",
	ErrNoLoader:              "no loader configured",
	ErrLoading:               "cannot load cacheable '%s'",
	ErrCheckOutdated:         "cannot check if '%s' is outdated",
	ErrDiscard:               "cannot discard '%s'",
	ErrDiscardedWhileLoading: "cacheable '%s' discarded while loading",
	ErrTimeout:               "timeout while %s",
	ErrFileLoading:           "cannot load file '%s'",
	ErrFileSize:              "file '%s' is too large",
	ErrFileChecking:          "cannot check file '%s'",
}

// EOF