forked from topcoder-platform/topcoder-react-utils
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
P1High priority. Important thing to focus on.High priority. Important thing to focus on.
Description
It looks like if an error happens, it currently calls both resolve() and then reject(), in both cases entering the if-guard that also throws Error('Internal error'). Note that inside resolve() we also assign error = null, but in the if-guard we compare error with undefined. Something is messed up here, and it also shadows the original error.
react-utils/src/server/renderer.tsx
Lines 442 to 454 in c785c8c
| const resolve = (arg: NodeJS.ReadableStream) => { | |
| if (error !== undefined) throw Error('Internal error'); | |
| error = null; | |
| resolveArg(arg); | |
| }; | |
| const reject = (arg: unknown) => { | |
| if (error !== undefined && error !== arg) { | |
| throw Error('Internal error'); | |
| } | |
| error = arg; | |
| rejectArg(arg as Error); | |
| }; |
Metadata
Metadata
Assignees
Labels
P1High priority. Important thing to focus on.High priority. Important thing to focus on.