+ classes = classNames
+ "item": true
+ "error-code": @_isError()
+
+
{@props.item.statusCode}{@_errorMessage()}
{@props.item.startMoment.format("HH:mm:ss")}
Run
Copy
@@ -19,6 +23,16 @@ class DeveloperBarCurlItem extends React.Component
clipboard = require('clipboard')
clipboard.writeText(@props.item.command)
+ _isError: ->
+ return false if @props.item.statusCode is "pending"
+ return not (parseInt(@props.item.statusCode) <= 399)
+
+ _errorMessage: ->
+ if (@props.item.errorMessage ? "").length > 0
+ return " | #{@props.item.errorMessage}"
+ else
+ return ""
+
_onRunCommand: =>
curlFile = "#{atom.getConfigDirPath()}/curl.command"
fs = require 'fs-plus'
diff --git a/internal_packages/worker-ui/lib/developer-bar-store.coffee b/internal_packages/worker-ui/lib/developer-bar-store.coffee
index aa14018fc..392cbf8c6 100644
--- a/internal_packages/worker-ui/lib/developer-bar-store.coffee
+++ b/internal_packages/worker-ui/lib/developer-bar-store.coffee
@@ -25,6 +25,7 @@ class DeveloperBarCurlRequest
@command = "curl -X #{request.method} #{headers}#{data} \"#{url}\""
@statusCode = statusCode ? error?.code ? "pending"
+ @errorMessage = error?.message ? error
@startMoment = moment(request.startTime)
@
diff --git a/internal_packages/worker-ui/stylesheets/worker-ui.less b/internal_packages/worker-ui/stylesheets/worker-ui.less
index fc5f86686..b64234aa3 100755
--- a/internal_packages/worker-ui/stylesheets/worker-ui.less
+++ b/internal_packages/worker-ui/stylesheets/worker-ui.less
@@ -118,6 +118,9 @@
.timestamp {
color: rgba(255,255,255,0.5);
}
+ .error-code {
+ background-color:#740000;
+ }
.item.status-code-500,
.item.status-code-501,
.item.status-code-502,