Skip to content

Commit

Permalink
Tweak error syntax to allow error extraction to succeed
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Sep 24, 2023
1 parent 0c498ef commit fd14829
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/toolkit/src/listenerMiddleware/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { addAbortSignalListener, catchRejection, noop } from './utils'
*/
export const validateActive = (signal: AbortSignal): void => {
if (signal.aborted) {
throw new TaskAbortError((signal as AbortSignalWithReason<string>).reason)
const { reason } = signal as AbortSignalWithReason<string>
throw new TaskAbortError(reason)
}
}

Expand Down

0 comments on commit fd14829

Please sign in to comment.