ddavison / rest-client

A simple REST client for the Atom editor!
http://atom.io/packages/rest-client
MIT License
53 stars 29 forks source link

Uncaught TypeError: Cannot read property 'elapsedTime' of undefined #87

Closed victuk closed 2 years ago

victuk commented 3 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.58.0 x64 Electron: 9.4.4 OS: Zorin OS Thrown From: rest-client package 1.3.3

Stack Trace

Uncaught TypeError: Cannot read property 'elapsedTime' of undefined

At /home/victor/.atom/packages/rest-client/lib/rest-client-view.coffee:285

TypeError: Cannot read property 'elapsedTime' of undefined
    at RestClientView.module.exports.RestClientView.onResponse (/packages/rest-client/lib/rest-client-view.coffee:285:31)
    at Request._callback (/packages/rest-client/lib/rest-client-view.coffee:1:1)
    at self.callback (/app.asar/node_modules/request/request.js:185:22)
    at Request.emit (events.js:223:5)
    at Request.onRequestError (/app.asar/node_modules/request/request.js:877:8)
    at ClientRequest.emit (events.js:228:7)
    at Socket.socketOnEnd (_http_client.js:440:9)
    at Socket.emit (events.js:228:7)
    at endReadableNT (_stream_readable.js:1185:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)

Commands

     -0:31.4.0 rest-client:show (textarea.)
     -0:24.6.0 core:copy (span.syntax--constant.syntax--langauge.syntax--rester)

Non-Core Packages

atom-vue 0.6.0 
laravel-snippets 2.1.0 
platformio-ide-terminal 2.10.1 
rest-client 1.3.3 
rester 1.1.1 
teletype 0.13.4 
vue-fmt 0.1.1 
DRNUMBER1 commented 2 years ago

So I found a small tweak for this error. so basically you go into this location in your drive (or where ever your files are stored of the packages.)

C:\Users\(YOUR_USER)\.atom\packages\rest-client\lib

now you have to select this file, rest-client-view.coffee

right click on it use any IDE, or import it in any editor to edit the file.

when you open it go to the 285 th line or the line where it says @showTime

in it change the line to @showTime("|ms")

save it and rerun the rest client

INFO: this will disable the time shown it took to get the request, but that's some other fix you can do later on studying a bit more of coffee or something......

ddavison commented 2 years ago

This error will occur when there was no response from a host.

Reproduced with: GET http://invalid-host.com