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

error in addAfterCall not present #9

Open
Floriferous opened this issue Aug 29, 2018 · 0 comments
Open

error in addAfterCall not present #9

Floriferous opened this issue Aug 29, 2018 · 0 comments

Comments

@Floriferous
Copy link
Contributor

Errors in addAfterCall don't seem to be passed through properly. I see this in the browser console, but it is not passed through to addAfterCall:

livedata_connection.js:1503 Uncaught (in promise) 
errorClass {isClientSafe: true, error: "dude", reason: "wut?", details: undefined, message: "wut? [dude]", …}
details
:
undefined
error
:
"dude"
errorType
:
"Meteor.Error"
isClientSafe
:
true
message
:
"wut? [dude]"
reason
:
"wut?"
stack
:
"Error: wut? [dude]↵    at Connection._livedata_result (http://localhost:4000/packages/ddp-client.js?hash=596654c9e82f6b457c5011012fdf33f98a8e2ae2:1796:23)↵    at Connection.onMessage (http://localhost:4000/packages/ddp-client.js?hash=596654c9e82f6b457c5011012fdf33f98a8e2ae2:1962:12)↵    at forEachCallback.callback (http://localhost:4000/packages/socket-stream-client.js?hash=dc67889bb9567b33ef1ac72c20ebfab45ad375f2:212:11)↵    at Array.forEach (<anonymous>)↵    at ClientStream.forEachCallback (http://localhost:4000/packages/socket-stream-client.js?hash=dc67889bb9567b33ef1ac72c20ebfab45ad375f2:294:31)↵    at SockJS.socket.onmessage.data [as onmessage] (http://localhost:4000/packages/socket-stream-client.js?hash=dc67889bb9567b33ef1ac72c20ebfab45ad375f2:211:14)↵    at SockJS.REventTarget.dispatchEvent (http://localhost:4000/packages/socket-stream-client.js?hash=dc67889bb9567b33ef1ac72c20ebfab45ad375f2:542:22)↵    at SockJS._dispatchMessage (http://localhost:4000/packages/socket-stream-client.js?hash=dc67889bb9567b33ef1ac72c20ebfab45ad375f2:1721:10)↵    at SockJS._didMessage (http://localhost:4000/packages/socket-stream-client.js?hash=dc67889bb9567b33ef1ac72c20ebfab45ad375f2:1787:16)↵    at WebSocket.that.ws.onmessage (http://localhost:4000/packages/socket-stream-client.js?hash=dc67889bb9567b33ef1ac72c20ebfab45ad375f2:1945:15)"
__proto__
:
Error

Here's a simple example of the setup:

const myMethod = new Mutation({name: 'myMethod', params: {} })

myMethod.setHandler(() => {
  throw new Meteor.Error('dude', 'what');
});

myMethod.run({})

Mutation.addAfterCall(({ error }) => {
  console.log(error) // undefined
})
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