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

Zaptyp / spotify-web-api-node / 16039825477

03 Jul 2025 01:59AM UTC coverage: 95.264%. Remained the same
16039825477

Pull #31

travis-ci

web-flow
Bump jest from 30.0.0 to 30.0.4

Bumps [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest) from 30.0.0 to 30.0.4.
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.0.4/packages/jest)

---
updated-dependencies:
- dependency-name: jest
  dependency-version: 30.0.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #31: Bump jest from 30.0.0 to 30.0.4

170 of 185 branches covered (91.89%)

Branch coverage included in aggregate %.

353 of 364 relevant lines covered (96.98%)

70.25 hits per line

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

77.27
/src/response-error.js
1
/* Timeout */
2
class NamedError extends Error {
3
  get name() {
4
    return this.constructor.name;
16✔
5
  }
6
}
7

8
class TimeoutError extends NamedError {
9
  constructor() {
10
    const message =
11
      "A timeout occurred while communicating with Spotify's Web API.";
4✔
12
    super(message);
4✔
13
  }
14
}
15

16
class WebapiRatelimitError extends NamedError {
17
  constructor(body, headers, statusCode) {
18
    const message = `Spotify API rate limit exceeded. Retry after ${headers.get('Retry-After')} seconds`;
×
19
    super(message);
×
20
    this.body = body;
×
21
    this.statusCode = statusCode;
×
22
  }
23
}
24

25
/* Web API Parent and fallback error */
26
class WebapiError extends NamedError {
27
  constructor(body, headers, statusCode, message) {
28
    super(message);
22✔
29
    this.body = body;
22✔
30
    this.headers = headers;
22✔
31
    this.statusCode = statusCode;
22✔
32
  }
33
}
34

35
/**
36
 * Regular Error
37
 * { status : <integer>, message : <string> }
38
 */
39
class WebapiRegularError extends WebapiError {
40
  constructor(body, headers, statusCode) {
41
    const message =
42
      "An error occurred while communicating with Spotify's Web API.\n" +
8✔
43
      'Details: ' +
44
      body.error.message +
45
      '.';
46

47
    super(body, headers, statusCode, message);
8✔
48
  }
49
}
50

51
/**
52
 * Authentication Error
53
 * { error : <string>, error_description : <string> }
54
 */
55
class WebapiAuthenticationError extends WebapiError {
56
  constructor(body, headers, statusCode) {
57
    const message =
58
      "An authentication error occurred while communicating with Spotify's Web API.\n" +
6✔
59
      'Details: ' +
60
      body.error +
61
      (body.error_description ? ' ' + body.error_description + '.' : '.');
3✔
62

63
    super(body, headers, statusCode, message);
6✔
64
  }
65
}
66

67
/**
68
 * Player Error
69
 * { status : <integer>, message : <string>, reason : <string> }
70
 */
71
class WebapiPlayerError extends WebapiError {
72
  constructor(body, headers, statusCode) {
73
    const message =
74
      "An error occurred while communicating with Spotify's Web API.\n" +
4✔
75
      'Details: ' +
76
      body.error.message +
77
      (body.error.reason ? ' ' + body.error.reason + '.' : '.');
2!
78

79
    super(body, headers, statusCode, message);
4✔
80
  }
81
}
82

83
module.exports = {
6✔
84
  WebapiError,
85
  TimeoutError,
86
  WebapiRegularError,
87
  WebapiAuthenticationError,
88
  WebapiPlayerError,
89
  WebapiRatelimitError
90
};
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