// doesnt work
const checklistBuildings = yield* pipe(
getRecordsByFilters({...})
Schema.decodeUnknown(Schema.Array(ChecklistBuildingFromKnack))(
checklistBuildingsResult,
),
Effect.catchTag(
"ParseError",
(e) =>
new KnackError({
message: "...",
}),
),
)
// works
const result = yield* getRecordsByFilter({...})
const checklistBuildings = yield* pipe(
Schema.decodeUnknown(Schema.Array(ChecklistBuildingFromKnack))(
checklistBuildingsResult,
),
Effect.catchTag(
"ParseError",
(e) =>
new KnackError({
message:
"Failed to transform a checklist building from knack to domain: " +
"\n" +
e.message,
}),
),
)
// doesnt work
const checklistBuildings = yield* pipe(
getRecordsByFilters({...})
Schema.decodeUnknown(Schema.Array(ChecklistBuildingFromKnack))(
checklistBuildingsResult,
),
Effect.catchTag(
"ParseError",
(e) =>
new KnackError({
message: "...",
}),
),
)
// works
const result = yield* getRecordsByFilter({...})
const checklistBuildings = yield* pipe(
Schema.decodeUnknown(Schema.Array(ChecklistBuildingFromKnack))(
checklistBuildingsResult,
),
Effect.catchTag(
"ParseError",
(e) =>
new KnackError({
message:
"Failed to transform a checklist building from knack to domain: " +
"\n" +
e.message,
}),
),
)