core-services-sdk 1.3.38 → 1.3.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-services-sdk",
3
- "version": "1.3.38",
3
+ "version": "1.3.39",
4
4
  "main": "src/index.js",
5
5
  "type": "module",
6
6
  "types": "types/index.d.ts",
@@ -35,7 +35,7 @@ export class HttpError extends Error {
35
35
  constructor(error = {}) {
36
36
  const { code, status, message, extendInfo } = error
37
37
 
38
- super(message || (status && httpStatus[status]) || code || 'Unknown error')
38
+ super(message || code || httpStatus[status] || 'Unknown error')
39
39
 
40
40
  this.code = code
41
41
  this.status = status
@@ -21,11 +21,11 @@ describe('HttpError', () => {
21
21
 
22
22
  it('should fallback to default message from status if message is missing', () => {
23
23
  const error = new HttpError({
24
- code: 'BAD_REQUEST',
24
+ code: 'Missing parameter x',
25
25
  status: httpStatus.BAD_REQUEST,
26
26
  })
27
27
 
28
- expect(error.message).toBe(httpStatus[httpStatus.BAD_REQUEST])
28
+ expect(error.message).toBe('Missing parameter x')
29
29
  expect(error.extendInfo).toBeUndefined()
30
30
  })
31
31