@pinelab/vendure-plugin-qls-fulfillment 1.0.0-beta.2 → 1.0.0-beta.3

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/README.md CHANGED
@@ -58,7 +58,11 @@ Make sure to monitor failed jobs: A job that failed after its retries were exhau
58
58
  1. An order was not pushed to QLS
59
59
  2. A product was not synced to QLS
60
60
 
61
- Monitor your logs for the string `QLS webhook error`. This means an incoming stock update webhook was not processed correctly.
61
+ Monitor your logs for the following text:
62
+ * `QLS webhook error` - This means an incoming stock update webhook was not processed correctly.
63
+ * `Error creating or updating variant` - This means a product was not synced to QLS.
64
+
65
+ Make sure to filter by logger context `QlsPlugin`, to prevent false positive alerts.
62
66
 
63
67
  ## Cancelling orders and manually pushing orders to QLS
64
68
 
@@ -108,13 +108,19 @@ let QlsProductService = class QlsProductService {
108
108
  let createdQlsProductsCount = 0;
109
109
  let updatedQlsProductsCount = 0;
110
110
  for (const variant of allVariants) {
111
- const existingQlsProduct = allQlsProducts.find((p) => p.sku == variant.sku);
112
- const result = await this.createOrUpdateProductInQls(ctx, client, variant, existingQlsProduct ?? null);
113
- if (result === 'created') {
114
- createdQlsProductsCount += 1;
111
+ try {
112
+ const existingQlsProduct = allQlsProducts.find((p) => p.sku == variant.sku);
113
+ const result = await this.createOrUpdateProductInQls(ctx, client, variant, existingQlsProduct ?? null);
114
+ if (result === 'created') {
115
+ createdQlsProductsCount += 1;
116
+ }
117
+ else if (result === 'updated') {
118
+ updatedQlsProductsCount += 1;
119
+ }
115
120
  }
116
- else if (result === 'updated') {
117
- updatedQlsProductsCount += 1;
121
+ catch (e) {
122
+ const error = (0, catch_unknown_1.asError)(e);
123
+ core_1.Logger.error(`Error creating or updating variant '${variant.sku}' in QLS: ${error.message}`, constants_1.loggerCtx, error.stack);
118
124
  }
119
125
  }
120
126
  core_1.Logger.info(`Created ${createdQlsProductsCount} products in QLS`, constants_1.loggerCtx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinelab/vendure-plugin-qls-fulfillment",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "Vendure plugin to fulfill orders via QLS.",
5
5
  "keywords": [
6
6
  "fulfillment",