Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
7fe5b20f
Commit
7fe5b20f
authored
Feb 15, 2019
by
Sietse Ringers
Committed by
David Venhoek
Feb 27, 2019
Browse files
Return more error messages to irmac user
parent
125f11fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/irmac/capi.go
View file @
7fe5b20f
...
...
@@ -106,13 +106,12 @@ func GetSessionResult(token *C.char) *C.char {
// And properly return results
if
result
==
nil
{
// core error
return
nil
}
resultJson
,
err
:=
json
.
Marshal
(
result
)
if
err
!=
nil
{
// encoding error
return
nil
return
C
.
CString
(
err
.
Error
())
}
return
C
.
CString
(
string
(
resultJson
))
}
...
...
@@ -129,13 +128,12 @@ func GetRequest(token *C.char) *C.char {
// And properly return results
if
result
==
nil
{
// core error
return
nil
}
resultJson
,
err
:=
json
.
Marshal
(
result
)
if
err
!=
nil
{
// encoding error
return
nil
return
C
.
CString
(
err
.
Error
())
}
return
C
.
CString
(
string
(
resultJson
))
}
...
...
@@ -192,7 +190,7 @@ func HandleProtocolMessage(path *C.char, method *C.char, headers C.struct_HttpHe
headerMap
,
err
:=
convertHeaders
(
headers
)
if
err
!=
nil
{
result
.
status
=
500
result
.
body
=
C
.
CString
(
""
)
result
.
body
=
C
.
CString
(
err
.
Error
()
)
result
.
SessionResult
=
nil
return
result
}
...
...
@@ -206,7 +204,7 @@ func HandleProtocolMessage(path *C.char, method *C.char, headers C.struct_HttpHe
sessionJson
,
err
:=
json
.
Marshal
(
session
)
if
err
!=
nil
{
result
.
status
=
500
result
.
body
=
C
.
CString
(
""
)
result
.
body
=
C
.
CString
(
err
.
Error
()
)
result
.
SessionResult
=
nil
return
result
}
...
...
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