refact(worker): update worker porxy handler signature to return an error (#1536)
Instead of requiring the each proxy handler to handle the webSocket connection closure. On error the worker handler will appropriately close the connection and event any errors.
This commit is contained in:
1 parent
c82d37bfba
commit
6a92e08928
5 files changed
+28
-39
No files matched your search
@@ -136,7 +136,7 @@ func TestRegisterHandler(t *testing.T) {
|
||||
t.Parallel()
|
||||
assert, require := assert.New(t), require.New(t)
|
||||
|
||||
fn := func(context.Context, Config, ...Option) { return }
|
||||
fn := func(context.Context, Config, ...Option) error { return nil }
|
||||
|
||||
err := RegisterHandler("protocol", fn)
|
||||
require.NoError(err)
|
||||
@@ -154,7 +154,7 @@ func TestGetHandler(t *testing.T) {
|
||||
t.Parallel()
|
||||
assert, require := assert.New(t), require.New(t)
|
||||
|
||||
fn := func(context.Context, Config, ...Option) {}
|
||||
fn := func(context.Context, Config, ...Option) error { return nil }
|
||||
|
||||
err := RegisterHandler("fn", fn)
|
||||
require.NoError(err)
|
||||
|
||||
Reference in new issue
Block a user