0KnowledgeNetwork / opt

mixnet server plugins, client apps, and other components
GNU Affero General Public License v3.0
2 stars 1 forks source link

feat: http_proxy/walletshield improve error response #23

Closed xendarboh closed 2 months ago

xendarboh commented 3 months ago

following #17

if http_proxy server plugin experiences an err related to its function (not a mixnet-related error), then write the error message as a response for the client. Currently it is returned as an error, and client doesn't consume it, only times out.

Pursue elimination of unnecessary client-side timeouts, when an error has occurred. In some cases, this can be a mis-configuration from the client (like unsupported/incorrect URL for RPC endpoint). Fail faster for better UX, and return an informative error message to the client.

Notes

Examples of errors that may be useful for the client

Example for writing response to client (vs returning Error)

go func() {
    s.write(&cborplugin.Response{ID: r.ID, SURB: r.SURB, Payload: payload})
}()
return nil