Commit 4b7f1137 authored by Tomas's avatar Tomas
Browse files

Changed the order of some SessionError fields.

parent d9f8152b
......@@ -108,7 +108,7 @@ func NewSession(credManager *CredentialManager, qr *Qr, handler Handler) {
case ActionUnknown:
fallthrough
default:
session.fail(&SessionError{ErrorCode: ErrorUnknownAction, Err: nil, Info: string(session.Action)})
session.fail(&SessionError{ErrorCode: ErrorUnknownAction, Info: string(session.Action)})
return
}
......@@ -270,7 +270,7 @@ func (session *session) sendResponse(message interface{}) {
return
}
if err = session.credManager.ConstructCredentials(response, session.irmaSession.(*IssuanceRequest)); err != nil {
session.fail(&SessionError{Err: err, ErrorCode: ErrorCrypto})
session.fail(&SessionError{ErrorCode: ErrorCrypto, Err: err})
return
}
log, err = session.createLogEntry(message) // TODO err
......
......@@ -57,7 +57,7 @@ func (transport *HTTPTransport) request(url string, method string, result interf
} else {
marshaled, err := json.Marshal(object)
if err != nil {
return &SessionError{Err: err, ErrorCode: ErrorSerialization}
return &SessionError{ErrorCode: ErrorSerialization, Err: err}
}
if verbose {
fmt.Printf("%s %s: %s\n", method, url, string(marshaled))
......@@ -72,7 +72,7 @@ func (transport *HTTPTransport) request(url string, method string, result interf
req, err := http.NewRequest(method, transport.Server+url, reader)
if err != nil {
return &SessionError{Err: err, ErrorCode: ErrorTransport}
return &SessionError{ErrorCode: ErrorTransport, Err: err}
}
req.Header.Set("User-Agent", "irmago")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment