File: errors.go

package info (click to toggle)
golang-github-tideland-golib 4.24.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,144 kB
  • sloc: makefile: 4
file content (43 lines) | stat: -rw-r--r-- 1,017 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
// Tideland Go Library - Generic JSON Processor - Errors
//
// Copyright (C) 2017 Frank Mueller / Tideland / Oldenburg / Germany
//
// All rights reserved. Use of this source code is governed
// by the new BSD license.

package gjp

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

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

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

// Error codes of the etc package.
const (
	ErrUnmarshalling = iota + 1
	ErrInvalidDocument
	ErrCorruptingDocument
	ErrInvalidPart
	ErrInvalidPath
	ErrPathTooLong
	ErrProcessing
)

var errorMessages = errors.Messages{
	ErrUnmarshalling:      "cannot unmarshal document",
	ErrInvalidDocument:    "invalid %s document, no internal implementation",
	ErrCorruptingDocument: "setting value would corrupt document",
	ErrInvalidPart:        "invalid part '%s' of the path",
	ErrInvalidPath:        "invalid path '%s'",
	ErrPathTooLong:        "path is too long",
	ErrProcessing:         "cannot process path '%s'",
}

// EOF