Skip to content

Commit

Permalink
fix: Print both HTTP status code and message
Browse files Browse the repository at this point in the history
Include statusMessage in the JSON output too.
  • Loading branch information
prantlf committed Nov 4, 2017
1 parent f5bb930 commit ac1f074
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/nettime
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ nettime({
console.log(result)
} else {
print(result.timings, unit)
console.log()
console.log('Status Code:', result.statusCode)
console.log('Status:', result.statusMessage,
'(' + result.statusCode + ')')
}
})
.catch(function (error) {
Expand Down
1 change: 1 addition & 0 deletions lib/nettime.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function nettime (options) {
timings.socketClose = getDuration()
resolve({
statusCode: response ? response.statusCode : 0,
statusMessage: response ? response.statusMessage : '',
timings: timings
})
})
Expand Down
2 changes: 2 additions & 0 deletions lib/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function printMilliseconds (timings) {
lastTiming = timing
}
}
console.log('-----------------------------------')
}

function printNanoseconds (timings) {
Expand All @@ -47,4 +48,5 @@ function printNanoseconds (timings) {
lastTiming = timing
}
}
console.log('-----------------------------------------------')
}

0 comments on commit ac1f074

Please # to comment.