@wix/motion-edm-autogen-transformations
Advanced tools
Comparing version 1.34.0 to 1.35.0
@@ -61,2 +61,18 @@ "use strict"; | ||
}); | ||
describe('runtime errors', () => { | ||
test('bubble up the runtime error', () => { | ||
const ambassadorHTTPError = { | ||
runtimeError: { | ||
stack: 'TypeError: val.toISOString is not a function', | ||
message: 'TypeError: val.toISOString is not a function' | ||
} | ||
}; | ||
expect((0, _.transformError)(ambassadorHTTPError)).toMatchObject({ | ||
constructor: Error, | ||
message: 'System error occurred', | ||
code: 'UNKNOWN', | ||
runtimeError: ambassadorHTTPError.runtimeError | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -63,0 +79,0 @@ describe('validation errors', () => { |
@@ -132,3 +132,6 @@ "use strict"; | ||
requestId: ambassadorHTTPError.requestId, | ||
code | ||
code, | ||
...(ambassadorHTTPError.runtimeError && { | ||
runtimeError: ambassadorHTTPError.runtimeError | ||
}) | ||
} | ||
@@ -135,0 +138,0 @@ }); |
@@ -51,2 +51,18 @@ import { anObject, aNumber, aRandomItemFrom, aRequestId, aString, } from '@wix/motion-runtime-test-context'; | ||
}); | ||
describe('runtime errors', () => { | ||
test('bubble up the runtime error', () => { | ||
const ambassadorHTTPError = { | ||
runtimeError: { | ||
stack: 'TypeError: val.toISOString is not a function', | ||
message: 'TypeError: val.toISOString is not a function', | ||
}, | ||
}; | ||
expect(transformError(ambassadorHTTPError)).toMatchObject({ | ||
constructor: Error, | ||
message: 'System error occurred', | ||
code: 'UNKNOWN', | ||
runtimeError: ambassadorHTTPError.runtimeError, | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -53,0 +69,0 @@ describe('validation errors', () => { |
@@ -101,6 +101,5 @@ import { constantCase } from 'constant-case'; | ||
message, | ||
extraProperties: { | ||
requestId: ambassadorHTTPError.requestId, | ||
code, | ||
}, | ||
extraProperties: Object.assign({ requestId: ambassadorHTTPError.requestId, code }, (ambassadorHTTPError.runtimeError && { | ||
runtimeError: ambassadorHTTPError.runtimeError, | ||
})), | ||
}); | ||
@@ -107,0 +106,0 @@ }; |
{ | ||
"name": "@wix/motion-edm-autogen-transformations", | ||
"version": "1.34.0", | ||
"version": "1.35.0", | ||
"license": "UNLICENSED", | ||
@@ -76,3 +76,3 @@ "author": { | ||
}, | ||
"falconPackageHash": "0ee14eedf1f03cabdb2dd83beec356e6ba28e481c3076188d7b252e5" | ||
"falconPackageHash": "c20dcce60b5bc710a92060e4fa12a62171fc4c5c9c81d87145eb341f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
399022
3506