pond: Basic message display in Block window

This commit is contained in:
Łukasz Magiera
2019-08-09 19:32:46 +02:00
parent 7f156c745f
commit e430f86b69
5 changed files with 30 additions and 7 deletions
+2 -1
View File
@@ -212,6 +212,7 @@ func (h handlers) handle(ctx context.Context, req request, w func(func(io.Writer
if handler.errOut != -1 {
err := callResult[handler.errOut].Interface()
if err != nil {
log.Warnf("error in RPC call: %s", err)
resp.Error = &respError{
Code: 1,
Message: err.(error).Error(),
@@ -232,7 +233,7 @@ func (h handlers) handle(ctx context.Context, req request, w func(func(io.Writer
}
if err := json.NewEncoder(w).Encode(resp); err != nil {
fmt.Println(err)
log.Error(err)
return
}
})
+1
View File
@@ -73,6 +73,7 @@ func (s *RPCServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
func rpcError(wf func(func(io.Writer)), req *request, code int, err error) {
log.Errorf("RPC Error: %s", err)
wf(func(w io.Writer) {
if hw, ok := w.(http.ResponseWriter); ok {
hw.WriteHeader(500)