-
Notifications
You must be signed in to change notification settings - Fork 62
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
Uncaught SyntaxError #68
Comments
Looks like the server was returning
|
Hi, Can you please provide information about the request you are sending and the full response you get from the servers? |
the same issue 2019-11-15T16:25:01.121Z error: uncaughtException: Unexpected token H in JSON at position 0
SyntaxError: Unexpected token H in JSON at position 0
at JSON.parse (<anonymous>)
at Request._callback (/app/node_modules/authorizenet/lib/apicontrollersbase.js:102:29)
at Request.self.callback (/app/node_modules/request/request.js:185:22)
at Request.emit (events.js:210:5)
at Request.EventEmitter.emit (domain.js:476:20)
at Request.<anonymous> (/app/node_modules/request/request.js:1161:10)
at Request.emit (events.js:210:5)
at Request.EventEmitter.emit (domain.js:476:20)
at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:299:28)
at IncomingMessage.emit (events.js:215:7)
at IncomingMessage.EventEmitter.emit (domain.js:476:20)
at endReadableNT (_stream_readable.js:1183:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) SyntaxError: Unexpected token H in JSON at position 0
at JSON.parse (<anonymous>)
at Request._callback (/app/node_modules/authorizenet/lib/apicontrollersbase.js:102:29)
at Request.self.callback (/app/node_modules/request/request.js:185:22)
at Request.emit (events.js:210:5)
at Request.EventEmitter.emit (domain.js:476:20)
at Request.<anonymous> (/app/node_modules/request/request.js:1161:10)
at Request.emit (events.js:210:5)
at Request.EventEmitter.emit (domain.js:476:20)
at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:299:28)
at IncomingMessage.emit (events.js:215:7)
at IncomingMessage.EventEmitter.emit (domain.js:476:20)
at endReadableNT (_stream_readable.js:1183:12) This happens when your server gives a 500 error. |
I can confirm this issue again. The block is not in try catch and causes a server crash. Happening a lot of times now and sometimes the payment also goes through but it returns the above response which is very strange. Is there anyone looking into it? I can submit a pull request to at least add better error handling to avoid crashes. |
Is this issue being looked at? I have just gotten the same issue and it seems to be still existing in latest version of the SDK. |
TCS-Dev saikumarkale- issue is fixed in the latest patch, September 2024 Release - v1.0.9 |
Had a server crash with the trace: SyntaxError: Unexpected token H in JSON at position 0
sdk-node/lib/apicontrollersbase.js
Line 102 in aab2dac
The text was updated successfully, but these errors were encountered: