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

opentrials / opentrials
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: v1.0.0
DEFAULT BRANCH: master
Repo Added 12 Feb 2016 03:40PM UTC
Files 60
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 improve-error-handling
branch: improve-error-handling
CHANGE BRANCH
x
Reset
  • improve-error-handling
  • 53-clear-query
  • 692-fix-unencoded-urls-in-emails
  • add-filter-for-publications
  • add-install-instructions
  • add-links-and-categories-to-data-contributions
  • add-search
  • add-terms-and-conditions
  • add-tooltip-text
  • add_csr_synopsis
  • all-identifiers-are-the-same
  • bug/423-fix-login-google-facebook
  • bug/446-fix-discrepancies-source-url
  • bug/529-fix-running-linter
  • bug/565-fix-datepicker-in-firefox
  • bug/622-persisting-notifications
  • bug/729-cannot-auth-users
  • bug/add-stats-page-back
  • bug/escape-fda-doc-text-search-query
  • bug/fda-docs-action-dates-are-wrong
  • bug/fix-bug-with-file-uploads
  • bug/fix-shrinkwrap
  • bug/fix-takedown-url
  • bug/limit-memory-usage-to-512mb
  • bug/osp-ribbon-dead-link
  • bug/records-source-id
  • bug/show-data-contributions-url
  • bug/study-results-filters-isnt-persistent-across-reloads
  • bug/trial-all-sources
  • colours
  • consent-manager
  • cookie-bar
  • data-discrepancies
  • discrepancies
  • dont-swallow-server-errors
  • escape-elasticsearch
  • escape-es-querystring-before-sending-to-api
  • feature/100-enable-ssl
  • feature/426-setup-sentry
  • feature/433-print-errors
  • feature/447-warn-anonymous-contributors
  • feature/468-update-terms-of-use
  • feature/480-sort-sources-by-name
  • feature/500-search-api
  • feature/501-fda-search-page
  • feature/558-data-contributions-categories
  • feature/574-improve-fda-docs-pages
  • feature/600-improve-fda-about-and-vote-link
  • feature/651-disable-autocomplete-except-locations
  • feature/652-pressing-enter-on-autocomplete-submits
  • feature/656-display-unregistered-trials
  • feature/699-prevent-blank-contributions
  • feature/708-add-filter-by-source
  • feature/715-strip-unknown-params-when-in-production
  • feature/717-info-search-results-order
  • feature/741-list-database-dumps
  • feature/758-eliminate-registration-filter
  • feature/add-document-id-to-contributions
  • feature/add-npm-command-to-change-user-role
  • feature/contribute-data
  • feature/credit-documentcloud-for-ocr
  • feature/display_exemption_date
  • feature/display_last_verification_date
  • feature/document-categories-from-api
  • feature/email-alerts-for-data-contributions
  • feature/embed-redash-visualisations
  • feature/expose-trialrecords
  • feature/fda-documents-previews
  • feature/fda-files-preview
  • feature/fda-section-for-trials
  • feature/improve-data-curation
  • feature/improve-rob-messages
  • feature/move-publications-list
  • feature/no-trial-contribution-warning
  • feature/ot-fda-about-text
  • feature/process-data-contributions
  • feature/remove-unused-code
  • feature/replace-doc-type-with-category
  • feature/review-data-contributions
  • feature/risks_of_bias
  • feature/seo-improvements
  • feature/set-datacontributions-approved-as-nullable
  • feature/trial-registered-boolean
  • feature/trigger-for-updated-at
  • feature/under-construction-disclaimer
  • feature/update-ot-fda-about-page
  • feature/user-login
  • feature/vote-for-us-badge
  • features/publications
  • fix-ui-for-trials-without-registration-date
  • fix-unstyled-flash
  • fix/727-remove-data-contribution-source
  • fix/correct-links-for-dumps
  • fix/display-missing-lay-summary-text
  • fix/update-links-terms-of-use-page
  • fix/visible-database-icon
  • fixes-and-enhancements-to-search
  • flash-messages
  • footer-links-spacing
  • handle-results-document
  • hotfix/contribution-category-display-fixes
  • hotfix/hide-discrepancies-link-when-unused
  • ignore-undefined-fields-for-discrepancy
  • implement-wireframe
  • improve-data-contribution-texts
  • improve-search-input-placeholder
  • improvements-to-discrepancies
  • link-styles
  • list-items
  • master
  • minor-ui-fixes
  • navigation
  • ok-panel
  • oki-panel
  • related-entities
  • remove-locations
  • remove-transparency-ranking-citation
  • remove-unused-fields
  • remove-vote-ribbon
  • rename-persons-to-people
  • rename-problems-to-conditions
  • search
  • search-clear-button-clears-entire-form
  • search-filters
  • separation-between-conditions-and-interventions-in-search-results
  • setup-docker
  • split_recruitment_status_into_status
  • trials-documents
  • trials-page
  • ui-improvements
  • ui-tweaks
  • update-fields-used-to-calculate-discrepancies
  • updating-dependencies
  • upgrade-node-6
  • use-uuid1-instead-of-uuid4
  • v1.0.0

pending completion
19

push

travis-ci

vitorbaptista
Improve error handling and tests for when API has problems

We're returning HTTP code 502 Bad Gateway for when there were some problems
with the API. This seems to be the best error code, considering that this app
is basically a gateway to the OpenTrials API.

I've also refactored how we test for the responses. We have to do
`JSON.parse(JSON.stringify(data))` to convert JavaScript primitives (like Date)
into JSON. It's better to do that than to manually convert the dates to a
string before checking for the API response, as we were doing before, because
we would have to keep track of what fields need to be converted. Converting to
JSON allows us not to care about this.

73 of 73 relevant lines covered (100.0%)

1.7 hits per line

Relevant lines Covered
Build:
Build:
73 RELEVANT LINES 73 COVERED LINES
1.7 HITS PER LINE
Source Files on improve-error-handling
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
19 improve-error-handling Improve error handling and tests for when API has problems We're returning HTTP code 502 Bad Gateway for when there were some problems with the API. This seems to be the best error code, considering that this app is basically a gateway to the Ope... push 26 Feb 2016 02:57PM UTC vitorbaptista travis-ci pending completion  
See All Builds (1012)
  • 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