Skip to content

Commit

Permalink
handled promise rejection (#966)
Browse files Browse the repository at this point in the history
* handled promise rejection

* fix linting issues

* linting fixes

* Update project.pbxproj

* Update yarn.lock

* fix IDEWorkspaceChecks file

* Revert "fix IDEWorkspaceChecks file"

This reverts commit 2e7bcf3.

* branch fixes

* branch fixes for xcode project

---------

Co-authored-by: Harsh Vardhan <[email protected]>
  • Loading branch information
hvardhan-unth and Harsh Vardhan authored Jun 27, 2024
1 parent 8a25765 commit 748a0fd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ export function deepCompare<T>(a: T, b: T): boolean {
}

export const createPromise = <T>(
timeout: number | undefined = undefined
timeout: number | undefined = undefined,
_errorHandler: (err: Error) => void = (_: Error) => {
//
}
): { promise: Promise<T>; resolve: (value: T) => void } => {
let resolver: (value: T) => void;
const promise = new Promise<T>((resolve, reject) => {
Expand All @@ -246,6 +249,8 @@ export const createPromise = <T>(
}
});

promise.catch(_errorHandler);

return {
promise: promise,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Expand Down

0 comments on commit 748a0fd

Please sign in to comment.