• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mitodl / micromasters
71%
master: 0%

Build:
Build:
LAST BUILD BRANCH: gs/cleanup_nginx_conf
DEFAULT BRANCH: master
Repo Added 07 Oct 2016 01:17PM UTC
Files 33
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH ap/promises
branch: ap/promises
CHANGE BRANCH
x
Reset
  • ap/promises
  • 2375_contact_course_team_api
  • 578_FoS_match_anywhere_in_string
  • 675_fake_users_for_prof_search
  • ap/dashboard-reducer-username
  • ap/date-field-non-numbers
  • ap/sidenav
  • enroll-now-ux
  • gdm_batch_grade_update_763
  • gs/cleanup_nginx_conf
  • gs/use_profile_for_switches
  • nl/fix-seed-db
  • release-candidate

pending completion
15940

push

travis-ci

Alice Pote
Fixed promise error handling

In many places where we use Promises (e.g. for making fetch requests to
our backend APIs) we were previously incorrectly handling promise
rejection. We were often doing `promise.then(fn).catch(fn)`, which is not
a great idea - then the `.catch` handler catches any errors in the
Promise AND any errors in the `.then` handler. Instead, we should prefer
to do `promise.then(resolve, reject)` - this makes the `reject` handler
narrower in it's responsibility.

The main problem with the former pattern is that the `.catch` handler
can swallow any exceptions which occur in the `.then` handler, and we
will not see them. This can lead to strange and unhelpful stack traces
(such as the react `getHostNode` error that crops up sometimes).

Anyway, this PR should fix it! I also simplified and streamlined our
`fetchJSONWithCSRF` function while I was at it.

pr #3022

244 of 361 branches covered (67.59%)

564 of 791 relevant lines covered (71.3%)

10.34 hits per line

Relevant lines Covered
Build:
Build:
791 RELEVANT LINES 564 COVERED LINES
10.34 HITS PER LINE
Source Files on ap/promises
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
15940 ap/promises Fixed promise error handling In many places where we use Promises (e.g. for making fetch requests to our backend APIs) we were previously incorrectly handling promise rejection. We were often doing `promise.then(fn).catch(fn)`, which is not a gre... push 29 Jul 2019 05:19PM UTC Alice Pote travis-ci pending completion  
See All Builds (22)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc