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

Generalize DDP error handling for non-Meteor errors #7305

Closed
3 tasks
shilman opened this issue Jun 26, 2016 · 2 comments
Closed
3 tasks

Generalize DDP error handling for non-Meteor errors #7305

shilman opened this issue Jun 26, 2016 · 2 comments
Labels

Comments

@shilman
Copy link
Contributor

shilman commented Jun 26, 2016

To prepare an NPM-ready SimpleSchema 2 that is decoupled from Meteor, @aldeed proposes the following changes to the DDP server:

When an Error is thrown while executing code as part of an HTTP or Websocket request, catch and examine the Error instance. If error.clientSafe is exactly true, then error.name, error.message, error.error, error.reason, and error.details may all be assumed to be safe to include in the response sent to the requesting client. Alternatively, if error.sanitizedError is an Error instance, then error.sanitizedError.name, error.sanitizedError.message, error.sanitizedError.error, error.sanitizedError.reason, and error.sanitizedError.details may all be assumed to be safe to include in the response sent to the requesting client. The error stack should never be sent.

For context, see discussion here: https://forums.meteor.com/t/meteor-guide-methods/19662/40

Proposed updates:

  • DDP server error handling
  • Unit tests
  • Documentation?
@shilman shilman changed the title Generalize DDP error handling to handle non-Meteor errors Generalize DDP error handling for non-Meteor errors Jun 26, 2016
@tmeasday tmeasday added confirmed We want to fix or implement it pull-requests-encouraged labels Jul 6, 2016
@tmeasday
Copy link
Contributor

tmeasday commented Jul 6, 2016

This seems reasonable to me.

In terms of docs:

Are the obvious spots to fix.

@hwillson
Copy link
Contributor

hwillson commented Jun 9, 2017

Keeping this feature request here for now (instead of closing/migrating it to meteor/meteor-feature-requests) as there is an open PR (#8756) against it.

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

No branches or pull requests

4 participants