-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "feat: add error handling to all public apis (#1907)""
This reverts commit ef1a977.
- Loading branch information
1 parent
4a9bd24
commit 4b5aa80
Showing
15 changed files
with
993 additions
and
430 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
* @rudderlabs/js-sdk | ||
|
||
/packages/analytics-js-integrations/src/ @rudderlabs/js-sdk-dm-intg-eng | ||
/packages/analytics-js-integrations/__fixtures__/ @rudderlabs/js-sdk-dm-intg-eng | ||
/packages/analytics-js-integrations/__tests__/ @rudderlabs/js-sdk-dm-intg-eng | ||
/packages/analytics-js-integrations/__mocks__/ @rudderlabs/js-sdk-dm-intg-eng | ||
/packages/analytics-js-integrations/README.md @rudderlabs/js-sdk-dm-intg-eng | ||
/packages/analytics-js-integrations/.size-limit.js @rudderlabs/js-sdk-dm-intg-eng | ||
/packages/analytics-js-integrations/src/ @rudderlabs/integrations | ||
/packages/analytics-js-integrations/__fixtures__/ @rudderlabs/integrations | ||
/packages/analytics-js-integrations/__tests__/ @rudderlabs/integrations | ||
/packages/analytics-js-integrations/__mocks__/ @rudderlabs/integrations | ||
/packages/analytics-js-integrations/README.md @rudderlabs/integrations | ||
/packages/analytics-js-integrations/.size-limit.js @rudderlabs/integrations | ||
|
||
/packages/analytics-js-common/src/constants/integrations/ @rudderlabs/js-sdk-dm-intg-eng | ||
/assets/integrations/AdobeAnalytics/ @rudderlabs/js-sdk-dm-intg-eng | ||
/examples/integrations/ @rudderlabs/js-sdk-dm-intg-eng | ||
/packages/analytics-js-common/src/constants/integrations/ @rudderlabs/integrations | ||
/assets/integrations/AdobeAnalytics/ @rudderlabs/integrations | ||
/examples/integrations/ @rudderlabs/integrations |
18 changes: 18 additions & 0 deletions
18
packages/analytics-js-common/__tests__/utilities/errors.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { dispatchErrorEvent } from '../../src/utilities/errors'; | ||
|
||
describe('Errors - utilities', () => { | ||
describe('dispatchErrorEvent', () => { | ||
it('should dispatch an error event', () => { | ||
const dispatchEvent = jest.fn(); | ||
const originalDispatchEvent = globalThis.dispatchEvent; | ||
|
||
globalThis.dispatchEvent = dispatchEvent; | ||
const error = new Error('Test error'); | ||
dispatchErrorEvent(error); | ||
expect(dispatchEvent).toHaveBeenCalledWith(new ErrorEvent('error', { error })); | ||
|
||
// Cleanup | ||
globalThis.dispatchEvent = originalDispatchEvent; | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.