SNIA/Swordfish-basic-web-client

"Something went wrong" needs to be more informative

Closed this issue · 2 comments

Description: The error message "Something went wrong" seen in various scenarios should be more descriptive with the HTTP error code and status message returned from the server. Similarly when a resource is accessed or modified, the error message and HTTP status code is vital for the user to determine what went wrong and fix it.

Error message seen on console when a invalid port was provided in the service add workflow:

Listening on port 3000, Live http://localhost:3000
C:\Workspace\Plugfest\SNIA_1_3\Swordfish-basic-web-client-master\app.js:114
if(res.headers['x-auth-token'] != null ){
^

TypeError: Cannot read property 'headers' of undefined
at Request._callback (C:\Workspace\Plugfest\SNIA_1_3\Swordfish-basic-web-client-master\app.js:114:19)
at self.callback (C:\Workspace\Plugfest\SNIA_1_3\Swordfish-basic-web-client-master\node_modules\request\request.js:186:22)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at Request.onRequestError (C:\Workspace\Plugfest\SNIA_1_3\Swordfish-basic-web-client-master\node_modules\request\request.js:878:8)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at Socket.socketErrorListener (_http_client.js:400:9)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)

Fixed in pull #10