Skip to content

Commit 23e5c21

Browse files
VineetKumarKushwahaVineet Kumar
andauthored
fix(discount-code-importer): improve error logging (#1833)
Co-authored-by: Vineet Kumar <javascripter.pune@outlook.com>
1 parent bf1af7c commit 23e5c21

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

.changeset/two-timers-flash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@commercetools/discount-code-importer': patch
3+
---
4+
5+
Improve Error Logging for Discount Importer

packages/discount-code-importer/src/main.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,14 @@ export default class DiscountCodeImport {
146146
.then((): Promise<void> => Promise.resolve())
147147
.catch(
148148
// eslint-disable-next-line
149-
(caughtError): Object =>
150-
new DiscountCodeImportError(
149+
(caughtError): Object => {
150+
this.logger.error(caughtError.message || caughtError)
151+
return new DiscountCodeImportError(
151152
'Processing batches failed',
152153
caughtError.message || caughtError,
153154
this._summary
154-
)
155-
)
155+
);
156+
})
156157
}
157158

158159
_createOrUpdate(

0 commit comments

Comments
 (0)