Skip to content

Commit 293e49e

Browse files
author
Christopher Willis-Ford
committed
Add specific dispatch.callSync exception for method-not-found
1 parent c9b9db8 commit 293e49e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/dispatch/central-dispatch.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ class CentralDispatch extends SharedDispatch {
5050
throw new Error(`Cannot use 'callSync' on remote provider for service ${service}.`);
5151
}
5252

53-
return provider[method].apply(provider, args);
53+
const func = provider[method];
54+
if (!func) {
55+
throw new Error(`Method ${method} not found on service ${service}`);
56+
}
57+
return func.apply(provider, args);
5458
}
5559
throw new Error(`Provider not found for service: ${service}`);
5660
}

0 commit comments

Comments
 (0)