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

GrottoCenter / grottocenter-api / 10996470946

23 Sep 2024 02:30PM UTC coverage: 45.381% (-0.8%) from 46.158%
10996470946

Pull #1316

github

vmarseguerra
feat(caver): adds delete for caver
Pull Request #1316: Adds delete for caver + Refactoring

726 of 2219 branches covered (32.72%)

Branch coverage included in aggregate %.

79 of 201 new or added lines in 24 files covered. (39.3%)

26 existing lines in 12 files now uncovered.

2433 of 4742 relevant lines covered (51.31%)

4.41 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