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

zulip / zulip-mobile / 6578
47%

Build:
DEFAULT BRANCH: master
Ran 03 Aug 2018 11:01AM UTC
Jobs 1
Files 363
Run time 21s
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

pending completion
6578

push

travis-ci

gnprice
api: Throw an error on invalid JSON in response.

The Zulip API guarantees that the response will always be JSON,
whether for an error or a success response.

If it's not, we should definitely treat that as an error, regardless
of the HTTP status code.  Because there is no JSON that parses to
`undefined` in JavaScript, the `undefined` that this `catch` handler
returns serves as a nice sentinel.

This can never happen anyway if the Zulip server is properly
configured and there isn't some bug in Zulip (and I'm not aware of any
bug we've had in the server code that would cause this particular
failure mode.)  But the Internet is big, and there are servers out
there that are misconfigured, so we should handle it properly.

In the wild, we've seen this (#2858) in a Sentry crash report, where
a request to /server_settings on a particular server produced an HTML
login page.  Moreover, that response was with HTTP status 200, so our
API layer would cheerfully return `undefined` to the caller, producing
a crash later when some other code innocently tried to look up a
property on the resulting `serverSettings` value.  With this fix,
trying to visit the same server from RealmScreen now produces an
appropriate error message, "Cannot connect to server", nicely
presented on that screen.

Fixes #2858.

1010 of 2083 branches covered (48.49%)

Branch coverage included in aggregate %.

1929 of 3743 relevant lines covered (51.54%)

34.22 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6578.1 (COVERALLS_REPO_TOKEN=4eYQDtWoBJlDz2QkxoQ2UcnmJFcOB7zkv) 03 Aug 2018 11:01AM UTC 0
50.45
Travis Job 6578.1
Source Files on build 6578
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #6578
  • 2a286f80 on github
  • Prev Build on master (#6577)
  • Next Build on master (#3309)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc