graphlit-client 1.0.20240418024 → 1.0.20240418026
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +11 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
@@ -424,8 +424,13 @@ class Graphlit {
|
|
424
424
|
catch (error) {
|
425
425
|
if (error instanceof core_1.ApolloError && error.graphQLErrors.length > 0) {
|
426
426
|
const errorMessage = error.graphQLErrors.map(err => err.message).join("\n");
|
427
|
+
console.error(errorMessage);
|
427
428
|
throw new Error(errorMessage);
|
428
429
|
}
|
430
|
+
if (error instanceof Error) {
|
431
|
+
console.error(error.message);
|
432
|
+
throw error;
|
433
|
+
}
|
429
434
|
else {
|
430
435
|
throw error;
|
431
436
|
}
|
@@ -446,15 +451,20 @@ class Graphlit {
|
|
446
451
|
throw new Error(errorMessage);
|
447
452
|
}
|
448
453
|
if (!result.data) {
|
449
|
-
throw new Error('No data returned from query');
|
454
|
+
throw new Error('No data returned from query.');
|
450
455
|
}
|
451
456
|
return result.data;
|
452
457
|
}
|
453
458
|
catch (error) {
|
454
459
|
if (error instanceof core_1.ApolloError && error.graphQLErrors.length > 0) {
|
455
460
|
const errorMessage = error.graphQLErrors.map(err => err.message).join("\n");
|
461
|
+
console.error(errorMessage);
|
456
462
|
throw new Error(errorMessage);
|
457
463
|
}
|
464
|
+
if (error instanceof Error) {
|
465
|
+
console.error(error.message);
|
466
|
+
throw error;
|
467
|
+
}
|
458
468
|
else {
|
459
469
|
throw error;
|
460
470
|
}
|