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

GrottoCenter / grottocenter-api / 11211548144

07 Oct 2024 08:23AM UTC coverage: 45.412% (-0.8%) from 46.184%
11211548144

push

github

vmarseguerra
feat(caver): adds delete for caver

726 of 2215 branches covered (32.78%)

Branch coverage included in aggregate %.

8 of 51 new or added lines in 1 file covered. (15.69%)

205 existing lines in 20 files now uncovered.

2456 of 4792 relevant lines covered (51.25%)

4.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

10.0
/api/responses/serverError.js
1
/* eslint-disable no-param-reassign */
2
/**
3
 * 500 (Server Error) Response
4
 *
5
 * Return always the same message ('An internal server error occurred.') whatever the data passed in.
6
 *
7
 * Usage:
8
 * return res.serverError();
9
 * return res.serverError(err);
10
 *
11
 * NOTE:
12
 * If something throws in a policy or controller, or an internal
13
 * error is encountered, Sails will call `res.serverError()`
14
 * automatically.
15
 *
16
 * @param  {Object | string | undefined} data
17
 */
18

19
module.exports = function serverError(data) {
1✔
UNCOV
20
  const { req } = this;
×
UNCOV
21
  const { res } = this;
×
UNCOV
22
  const sails = req._sails; // eslint-disable-line no-underscore-dangle
×
UNCOV
23
  const logResponse = sails.helpers.logResponse.with;
×
UNCOV
24
  const formatResponseData = sails.helpers.formatResponseData.with;
×
25

UNCOV
26
  const httpCode = 500;
×
UNCOV
27
  res.status(httpCode);
×
UNCOV
28
  logResponse.with({ httpCode, data });
×
UNCOV
29
  return res.json(
×
30
    formatResponseData.with({
31
      data: { message: 'An internal server error occurred.' },
32
    })
33
  );
34
};
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

© 2026 Coveralls, Inc