filepreviews / filepreviews-node Goto Github PK
View Code? Open in Web Editor NEWNode.js client library for the FilePreviews.io service.
Home Page: http://filepreviews.io
License: MIT License
Node.js client library for the FilePreviews.io service.
Home Page: http://filepreviews.io
License: MIT License
Hi guys,
Just discovered an error that might be occurring since we upgraded to Node v16.13.2 (from 12), though it's potentially been happening for previous versions and we've only noticed it now because it now crashes our servers - due to the unhandled exception change in Node.
Anyway, it seems the onError handler isn't safe if the response is null.
filepreviews-node/lib/index.js
Lines 89 to 92 in 3c6c5f3
See the stack trace below:
/home/ubuntu/www/node_modules/filepreviews/lib/index.js:92
this.log('API request error: ' + response.statusCode);
^
TypeError: Cannot read properties of undefined (reading 'statusCode')
at FilePreviews.<anonymous> (/home/ubuntu/www/node_modules/filepreviews/lib/index.js:92:47)
at Request._callback (/home/ubuntu/www/node_modules/filepreviews/lib/index.js:135:9)
at self.callback (/home/ubuntu/www/node_modules/request/request.js:185:22)
at Request.emit (node:events:390:28)
at Request.emit (node:domain:475:12)
at Request.onRequestError (/home/ubuntu/www/node_modules/request/request.js:877:8)
at ClientRequest.emit (node:events:390:28)
at ClientRequest.emit (node:domain:475:12)
at TLSSocket.socketErrorListener (node:_http_client:447:9)
at TLSSocket.emit (node:events:390:28)
at TLSSocket.emit (node:domain:475:12)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Thanks!
We're getting ready to release v2 of the FilePreviews API. We already have a reference implementation of in filepreviews/filepreviews-python#3 which we're using to update libraries.
DO you plan tu support typescript for this lib ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.