title: How to handle Array buffer allocation failed in nodejs?
body: <p>I have successfully upload image in nodejs and I am using multer for that.
  But sometime " Array buffer allocation failed " error occurs and I want to handle that error. I tried to keep the code in try-catch block even though still it throws the error and I am unable to figure out how to handle this error or how to avoid that error ?
  Able to upload file but when I try to change height and width and making a new image then it throws an error</p>
  
  <pre><code>Uncaught RangeError: Array buffer allocation failed
  
   at Buffer.Uint8Array (native)
  
   at FastBuffer (buffer.js:8:1)
  </code></pre>
  
  <p><strong>OR</strong> </p>
  
  <pre><code> Array buffer allocation failed
  
     at Buffer.Uint8Array (native)
  
     at FastBuffer (buffer.js:8:1)
  
     RangeError: Array buffer allocation failed
      at new Uint8Array (native)
      at Object.getData (/Burg_nodejs/node_modules/jpeg-js/lib/decoder.js:797:18)
      at Object.copyToImageData (/Burg_nodejs/node_modules/jpeg-js/lib/decoder.js:913:23)
      at Object.decode (/Burg_nodejs/node_modules/jpeg-js/lib/decoder.js:985:11)
      at Jimp.parseBitmap (/Burg_nodejs/node_modules/jimp/index.js:310:36)
      at /Burg_nodejs/node_modules/jimp/index.js:202:29
      at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:446:3)
  </code></pre>
  
  <p>Any suggestion will be much more helpful</p>