File: errors.go

package info (click to toggle)
docker-registry 2.8.1%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,148 kB
  • sloc: sh: 331; makefile: 82
file content (38 lines) | stat: -rw-r--r-- 1,277 bytes parent folder | download | duplicates (7)
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
package main

import (
	"net/http"

	"github.com/docker/distribution/registry/api/errcode"
)

var (
	errGroup = "tokenserver"

	// ErrorBadTokenOption is returned when a token parameter is invalid
	ErrorBadTokenOption = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:   "BAD_TOKEN_OPTION",
		Message: "bad token option",
		Description: `This error may be returned when a request for a
		token contains an option which is not valid`,
		HTTPStatusCode: http.StatusBadRequest,
	})

	// ErrorMissingRequiredField is returned when a required form field is missing
	ErrorMissingRequiredField = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:   "MISSING_REQUIRED_FIELD",
		Message: "missing required field",
		Description: `This error may be returned when a request for a
		token does not contain a required form field`,
		HTTPStatusCode: http.StatusBadRequest,
	})

	// ErrorUnsupportedValue is returned when a form field has an unsupported value
	ErrorUnsupportedValue = errcode.Register(errGroup, errcode.ErrorDescriptor{
		Value:   "UNSUPPORTED_VALUE",
		Message: "unsupported value",
		Description: `This error may be returned when a request for a
		token contains a form field with an unsupported value`,
		HTTPStatusCode: http.StatusBadRequest,
	})
)