Repository: next.js
Issue: Pending Promises sent from server to client component crash if they reject without a reason
Labels: bug

### Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/still-cherry-8wks5w

### To Reproduce

1. Load the codesandbox (enable VS Code web)
2. Load the preview pane
3. See the "Loading..." Suspense fallback never disappears
4. See the `TypeError: Cannot read properties of undefined (reading 'digest')` error in the terminal

It boils down to a code block like this:

```tsx
<ErrorBoundary fallback={<ErrorFallback />}>
  <Suspense fallback={<p>Loading...</p>}>
    <Table dataPromise={promiseThatWillReject} />
  </Suspense>
</ErrorBoundary>
```

If that `promiseThatWillReject` calls its `reject()` function without any argument, the bug is encountered.

### Current vs. Expected behavior

Rejecting a promise without a rejection reason causes the Next response to crash with an error inside `create-error-handler.tsx`. This causes the page response to never finish. The error does not bubble up to the ErrorBoundary, and the page just breaks.

I expect the rejected promise to trigger my ErrorBoundary, or at least give me some kind of message telling me I need to provide an argument to my `reject()` call.



### Provide environment information

```bash
Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 15.0.0-canary.70 // Latest available version is detected (15.0.0-canary.70).
  eslint-config-next: N/A
  react: 19.0.0-rc.0
  react-dom: 19.0.0-rc.0
  typescript: 5.3.3
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Not sure, Developer Experience

### Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local)

### Additional context

This appears to be because `create-error-handler.tsx` expects its `err: any` argument to be present, but when you `reject()` a promise without an argument, this does not happen (`err` is undefined).

To debug, I cloned nextjs, copied my app inside of it as per the [debugging instructions](https://github.com/edspencer/next.js/blob/canary/contributing/core/vscode-debugger.md) and debugged with VS Code. The issue starts inside of `react-server-dom-webpack-server.edge.development.js`, which passes the (in this case undefined) `reason` to `logRecoverableError`. I guess this part is React code, rather than Next code. That part seems reasonable, as does the next call which calls `requestStorage.run(undefined, onError, error)` (the `error` here is undefined).

The error is caused when `create-error-handler.tsx` attempts to read `err.digest` when `err` is undefined. This issue is occurring at the intersection of React and Next, but it looks like it should be addressed on the Next side, specifically by not assuming that `err` is defined. Perhaps just defaulting `err` to a `new Error()` inside `create-error-handler.tsx` would be a reasonable solution. 

The terminal error looks like this:

```
TypeError: Cannot read properties of undefined (reading 'digest')
    at /Users/ed/Code/rsc-examples/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:36:17750
    at AsyncLocalStorage.run (node:async_hooks:346:14)
    at eL (/Users/ed/Code/rsc-examples/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:273717)
    at /Users/ed/Code/rsc-examples/node_modules/next/dist/compiled/next-server/app-page.runtime.dev.js:35:269545
```