Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
8ee7aa5c
Commit
8ee7aa5c
authored
Apr 02, 2017
by
keks
Committed by
Jan Winkelmann
Apr 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: restore and test original error order
License: MIT Signed-off-by:
Jan Winkelmann
<
j-winkelmann@tuhh.de
>
parent
1c50ec0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
commands/response.go
commands/response.go
+1
-1
commands/response_test.go
commands/response_test.go
+6
-0
No files found.
commands/response.go
View file @
8ee7aa5c
...
...
@@ -17,8 +17,8 @@ type ErrorType uint
const
(
ErrNormal
ErrorType
=
iota
// general errors
ErrClient
// error was caused by the client, (e.g. invalid CLI usage)
ErrNotFound
// == HTTP 404 Not Found
ErrImplementation
// programmer error in the server
ErrNotFound
// == HTTP 404 Not Found
// TODO: add more types of errors for better error-specific handling
)
...
...
commands/response_test.go
View file @
8ee7aa5c
...
...
@@ -53,6 +53,12 @@ func TestMarshalling(t *testing.T) {
}
}
func
TestErrTypeOrder
(
t
*
testing
.
T
)
{
if
ErrNormal
!=
0
||
ErrClient
!=
1
||
ErrImplementation
!=
2
||
ErrNotFound
!=
3
{
t
.
Fatal
(
"ErrType order is wrong"
)
}
}
func
removeWhitespace
(
input
string
)
string
{
input
=
strings
.
Replace
(
input
,
" "
,
""
,
-
1
)
input
=
strings
.
Replace
(
input
,
"
\t
"
,
""
,
-
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment