Skip to content

Commit

Permalink
fix: cause.runtime exception effect upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaAmaju committed Dec 18, 2023
1 parent 121ed1e commit 22f76d2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/internal/interceptor.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Tag } from "effect/Context";
import * as Effect from "effect/Effect";
import * as Cause from "effect/Cause";
import * as Chunk from 'effect/Chunk'
import * as Option from 'effect/Option'
import * as Chunk from "effect/Chunk";
import * as Option from "effect/Option";
import { dual } from "effect/Function";

import { HttpError } from "./error.js";
Expand Down Expand Up @@ -41,13 +41,13 @@ export function compose(initiator: Effect.Effect<Context, any, Response>) {
): Effect.Effect<never, HttpError, Response> {
if (i <= index) {
return Effect.die(
Cause.RuntimeException("proceed() called multiple times")
new Cause.RuntimeException("proceed() called multiple times")
);
}

index = i;

let handler = Option.getOrNull(Chunk.get(interceptors, i))
let handler = Option.getOrNull(Chunk.get(interceptors, i));

if (!handler || i === interceptors.length) {
handler = initiator;
Expand Down

0 comments on commit 22f76d2

Please sign in to comment.