You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.
I have a mojit with a binder that tunnels a database query to its server-side controller. In the binder, the response is processed by a ModelList hooked to a DataTable. Everything works fine as long as there are no errors in the database. In the case of an error, everything works up to the point when the controller calls ac.error(err), where err has the following form (as I get it from pg and as rendered by console.log in the server):
I haven't tracked all the goings-on between the call to ac.error() and the moment when stuff gets written to the socket, but at the other end of it, I see
error: (mojito-output-buffer): Error executing: 'undefined':
error: (mojito-output-buffer): column "test" does not exist
error: (mojito-output-buffer):
error: column "test" does not exist
at Connection.parseE (/home/bfs/mojito/bfs/node_modules/pg/lib/connection.js:526:11)
at Connection.parseMessage (/home/bfs/mojito/bfs/node_modules/pg/lib/connection.js:356:17)
at Socket.<anonymous> (/home/bfs/mojito/bfs/node_modules/pg/lib/connection.js:105:22)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:745:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:407:10)
at emitReadable (_stream_readable.js:403:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
This raises a few questions:
What's up with the undefined id in OutputBuffer? What does it mean and how do I define it?
What's that unknown request status of 42703? Is that an intended value?
Where did the error go? The response has no body.
Why does the ModelList's error event not fire immediately? Instead, it fires like this half-a-minute later:
Thanks for pointing this out. The OutputBuffer's undefined id is definitely something we should fix; there are a couple of places where error messages can be more clear. I am not sure what is going on exactly, but I will try to setup a test case where there is a tunnel call that ends up calling ac.error. Mojito should be able to handle passing an object to ac.error. The best way to debug what is going on is to go through the call stack within ac.error and see where the response is getting malformed resulting it what seems to be a JSON parse error.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have a mojit with a binder that tunnels a database query to its server-side controller. In the binder, the response is processed by a ModelList hooked to a DataTable. Everything works fine as long as there are no errors in the database. In the case of an error, everything works up to the point when the controller calls
ac.error(err)
, whereerr
has the following form (as I get it frompg
and as rendered byconsole.log
in the server):I haven't tracked all the goings-on between the call to
ac.error()
and the moment when stuff gets written to the socket, but at the other end of it, I seewhile
mojito-output-buffer
reports:This raises a few questions:
id
in OutputBuffer? What does it mean and how do I define it?error
event not fire immediately? Instead, it fires like this half-a-minute later:I will appreciate any clues for how to debug it further, or for how to do it right.
The text was updated successfully, but these errors were encountered: