Skip to content

Commit f28beb4

Browse files
committed
fix: improve error handling in hypercert orders resolver
- Replace throwing an error with console.error logging - Return a default value when order fetching fails
1 parent de2ef0e commit f28beb4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/graphql/schemas/resolvers/hypercertResolver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class HypercertResolver extends HypercertBaseResolver {
8080

8181
@FieldResolver()
8282
async orders(@Root() hypercert: Hypercert) {
83-
console.log(hypercert.hypercert_id);
8483
if (!hypercert.id || !hypercert.hypercert_id) {
8584
return;
8685
}
@@ -175,9 +174,10 @@ class HypercertResolver extends HypercertBaseResolver {
175174
count: ordersCount || 0,
176175
};
177176
} catch (e) {
178-
throw new Error(
177+
console.error(
179178
`[HypercertResolver::orders] Error fetching orders for ${hypercert.hypercert_id}: ${(e as Error).toString()}`,
180179
);
180+
return defaultValue;
181181
}
182182
}
183183

0 commit comments

Comments
 (0)