Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stub exceptions are logged instead of thrown in Meteor Methods, preventing throwStubExceptions from working as intended #438

Open
ThaumRystra opened this issue Mar 8, 2022 · 0 comments

Comments

@ThaumRystra
Copy link

Because of this block, all exceptions that would throw on the server when calling Collection.update without a callback instead log on the client instead, which is inconsistent and breaks simulated methods.

The comment for the same block claims "Client can't block, so it can't report errors by exception" is misleading. In simulated methods the client can report errors by exception just fine.

The default for meteor:validatedMethods is for throwStubExceptions to be true, which should prevent methods that error on the client from being sent to the server, but because of the enforced callback on update and insert collection methods, the client cannot simulate the server's behavior correctly.

To Reproduce

  1. Call Collection.update( ) in a validated method using an update that does not match the schema
  2. The update succeeds on the client, but logs an error, and then throws the same error on the server which gets returned to the client's method callback

Expected behavior

Collection.update should throw an error consistently on both the client and the server when used without a callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant