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

exception handeling for JSON.parse #8

Open
rene2u9 opened this issue Jul 13, 2017 · 0 comments
Open

exception handeling for JSON.parse #8

rene2u9 opened this issue Jul 13, 2017 · 0 comments

Comments

@rene2u9
Copy link

rene2u9 commented Jul 13, 2017

First of all thanks for this great and simple sparql module!
I use it to get information from various endpoints and ran into some errors.

<?xml version="1.0"?>
^

SyntaxError: Unexpected token < in JSON at position 0
at Object.parse (native)
at Request.callback (.\node_modules\sparql\lib\sparql.coffee:138:59)
at IncomingMessage. (.\node_modules\request\main.js:214:44)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

I had some problems handeling bad response formats and was not able to catch occuring exceptions. I fixed it by changing sparql.coffee:79 cb? null, try JSON.parse body catch e. i am new to nodejs and never code cs so im not sure if this is even an issue or my fault.

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