-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patherrors.go
48 lines (36 loc) · 1.38 KB
/
errors.go
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
// Copyright (c) 2016 IBM Corp. All rights reserved.
// Use of this source code is governed by the Apache License,
// Version 2.0, a copy of which can be found in the LICENSE file.
// All of our errors are defined in this file
package main
import (
"fmt"
)
// RegError describes a registration error.
type RegError struct {
message string
}
func (e RegError) Error() string { return fmt.Sprintf("REG.ERROR: %s", e.message) }
// Payload error describes an error concerning the top-level structure of an
// incoming webservice payload. Payload errors do not deal with the contents
// of the javascript payload component
type PayloadError struct {
message string
}
func (e PayloadError) Error() string { return fmt.Sprintf("PAYLOAD.ERROR: %s", e.message) }
// JSPayloadError describes a problem with the structure of the
// javascript payload component.
type JSPayloadError struct {
message string
}
func (e JSPayloadError) Error() string { return fmt.Sprintf("JS.PAYLOAD.ERROR: %s", e.message) }
// ArgError describes an error with the commandline arguments.
type ArgError struct {
message string
}
func (e ArgError) Error() string { return fmt.Sprintf("ARG.ERROR: %s", e.message) }
// VersionError describes a mismatch between requested and supported versions.
type VersionError struct {
message string
}
func (e VersionError) Error() string { return fmt.Sprintf("VERSION.ERROR: %s", e.message) }