Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

display more useful output on errors #187 #188

Merged
merged 5 commits into from
Feb 22, 2019
Merged

display more useful output on errors #187 #188

merged 5 commits into from
Feb 22, 2019

Conversation

rofe
Copy link
Contributor

@rofe rofe commented Feb 21, 2019

Fixes #187

@rofe rofe requested a review from trieloff February 21, 2019 15:06
Copy link
Contributor

@trieloff trieloff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check that the error output is only shown in non-production environments. We have a predicate for that already.

@trieloff
Copy link
Contributor

See also adobe/helix-simulator#17

@codecov
Copy link

codecov bot commented Feb 21, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@5dc0e80). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##             master   #188   +/-   ##
=======================================
  Coverage          ?   100%           
=======================================
  Files             ?     38           
  Lines             ?    837           
  Branches          ?    161           
=======================================
  Hits              ?    837           
  Misses            ?      0           
  Partials          ?      0
Impacted Files Coverage Δ
src/html/set-status.js 100% <100%> (ø)
src/defaults/html.pipe.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5dc0e80...7298f9e. Read the comment docs.

@rofe
Copy link
Contributor Author

rofe commented Feb 21, 2019

Please check that the error output is only shown in non-production environments

Like so?

src/html/set-status.js Outdated Show resolved Hide resolved
test/testSetStatus.js Outdated Show resolved Hide resolved
@rofe
Copy link
Contributor Author

rofe commented Feb 22, 2019

Readded lost response object (thanks @tripodsan!)

@rofe rofe requested a review from tripodsan February 22, 2019 09:02
@rofe rofe requested a review from trieloff February 22, 2019 09:11
@trieloff
Copy link
Contributor

@rofe it's generally a better idea to pull the if statement out of the function and apply it in the pipeline like this:

.error(detailed-status).when(() => !production())
.error(terse-status).when(() => production())

that way, your detailed-status and terse-status functions can stay simple, and you easily get 100% branch coverage in testing because there is only one branch in each function.

@rofe rofe merged commit a264425 into master Feb 22, 2019
@rofe rofe deleted the error-output branch February 22, 2019 12:25
@trieloff
Copy link
Contributor

trieloff commented Mar 8, 2019

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants