Fix
This commit is contained in:
@@ -58,7 +58,7 @@ const mapErrors = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
|
|||||||
Empty: cause => Effect.fail(
|
Empty: cause => Effect.fail(
|
||||||
new TRPCError({
|
new TRPCError({
|
||||||
code: "INTERNAL_SERVER_ERROR",
|
code: "INTERNAL_SERVER_ERROR",
|
||||||
cause: new TRCPErrorCause(cause),
|
cause: new TRPCErrorCause(cause),
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ const mapErrors = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
|
|||||||
? cause.error
|
? cause.error
|
||||||
: new TRPCError({
|
: new TRPCError({
|
||||||
code: "INTERNAL_SERVER_ERROR",
|
code: "INTERNAL_SERVER_ERROR",
|
||||||
cause: new TRCPErrorCause(cause),
|
cause: new TRPCErrorCause(cause),
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -76,35 +76,34 @@ const mapErrors = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
|
|||||||
? cause.defect
|
? cause.defect
|
||||||
: new TRPCError({
|
: new TRPCError({
|
||||||
code: "INTERNAL_SERVER_ERROR",
|
code: "INTERNAL_SERVER_ERROR",
|
||||||
cause: new TRCPErrorCause(cause),
|
cause: new TRPCErrorCause(cause),
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
|
|
||||||
Interrupt: cause => Effect.fail(
|
Interrupt: cause => Effect.fail(
|
||||||
new TRPCError({
|
new TRPCError({
|
||||||
code: "INTERNAL_SERVER_ERROR",
|
code: "INTERNAL_SERVER_ERROR",
|
||||||
cause: new TRCPErrorCause(cause),
|
cause: new TRPCErrorCause(cause),
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
|
|
||||||
Sequential: cause => Effect.fail(
|
Sequential: cause => Effect.fail(
|
||||||
new TRPCError({
|
new TRPCError({
|
||||||
code: "INTERNAL_SERVER_ERROR",
|
code: "INTERNAL_SERVER_ERROR",
|
||||||
cause: new TRCPErrorCause(cause),
|
cause: new TRPCErrorCause(cause),
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
|
|
||||||
Parallel: cause => Effect.fail(
|
Parallel: cause => Effect.fail(
|
||||||
new TRPCError({
|
new TRPCError({
|
||||||
code: "INTERNAL_SERVER_ERROR",
|
code: "INTERNAL_SERVER_ERROR",
|
||||||
cause: new TRCPErrorCause(cause),
|
cause: new TRPCErrorCause(cause),
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
export class TRPCErrorCause<E> extends Error {
|
||||||
export class TRCPErrorCause<E> extends Error {
|
|
||||||
constructor(readonly cause: Cause.Cause<E>) {
|
constructor(readonly cause: Cause.Cause<E>) {
|
||||||
super()
|
super()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user