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-cmds
Commits
4e484d22
Commit
4e484d22
authored
Aug 23, 2018
by
keks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better logging, errors, fmt
parent
0e8aad8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
command.go
command.go
+1
-1
encoding.go
encoding.go
+1
-1
writer.go
writer.go
+3
-1
No files found.
command.go
View file @
4e484d22
...
@@ -76,7 +76,7 @@ func (c *Command) Call(req *Request, re ResponseEmitter, env Environment) {
...
@@ -76,7 +76,7 @@ func (c *Command) Call(req *Request, re ResponseEmitter, env Environment) {
err
:=
c
.
call
(
req
,
re
,
env
)
err
:=
c
.
call
(
req
,
re
,
env
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Debug
(
"error occured in call, closing with error: %s"
,
err
)
log
.
Debug
f
(
"error occured in call, closing with error: %s"
,
err
)
}
}
closeErr
=
re
.
CloseWithError
(
err
)
closeErr
=
re
.
CloseWithError
(
err
)
...
...
encoding.go
View file @
4e484d22
...
@@ -94,7 +94,7 @@ func MakeTypedEncoder(f interface{}) func(*Request) func(io.Writer) Encoder {
...
@@ -94,7 +94,7 @@ func MakeTypedEncoder(f interface{}) func(*Request) func(io.Writer) Encoder {
return
MakeEncoder
(
func
(
req
*
Request
,
w
io
.
Writer
,
i
interface
{})
error
{
return
MakeEncoder
(
func
(
req
*
Request
,
w
io
.
Writer
,
i
interface
{})
error
{
if
reflect
.
TypeOf
(
i
)
!=
valType
{
if
reflect
.
TypeOf
(
i
)
!=
valType
{
return
fmt
.
Errorf
(
"unexpected type
:
%T
"
,
i
)
return
fmt
.
Errorf
(
"unexpected type %T
, expected %v"
,
i
,
valType
)
}
}
out
:=
val
.
Call
([]
reflect
.
Value
{
out
:=
val
.
Call
([]
reflect
.
Value
{
...
...
writer.go
View file @
4e484d22
...
@@ -114,7 +114,9 @@ func (re *writerResponseEmitter) CloseWithError(err error) error {
...
@@ -114,7 +114,9 @@ func (re *writerResponseEmitter) CloseWithError(err error) error {
return
re
.
Close
()
return
re
.
Close
()
}
}
cwe
,
ok
:=
re
.
c
.
(
interface
{
CloseWithError
(
error
)
error
})
cwe
,
ok
:=
re
.
c
.
(
interface
{
CloseWithError
(
error
)
error
})
if
ok
{
if
ok
{
re
.
closed
=
true
re
.
closed
=
true
return
cwe
.
CloseWithError
(
err
)
return
cwe
.
CloseWithError
(
err
)
...
...
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