fsyntax / medusa-plugin-printful

Printful Integration for Medusajs
30 stars 6 forks source link

Product creation fails if there is no main_category_id #2

Closed huotarih closed 1 year ago

huotarih commented 1 year ago

2023-07-24T13:00:21.591565416Z [medusa-plugin-printful]: Processing job #21 - [315141474] HH x adidas - dad hat 2023-07-24T13:00:22.477648800Z [medusa-plugin-printful]: Error occurred while trying to create a product! Attempt 1 of 10. Error: [object Object] 2023-07-24T13:00:22.477731553Z { 2023-07-24T13:00:22.477740653Z code: 404, 2023-07-24T13:00:22.477746738Z result: 'Not Found', 2023-07-24T13:00:22.477752495Z error: { reason: 'NotFound', message: 'Not Found' } 2023-07-24T13:00:22.477758379Z } 2023-07-24T13:00:22.478422796Z [medusa-plugin-printful]: Error occurred while trying to create a product! Attempt 1 of 10. Error: TypeError: Cannot read properties of undefined (reading 'main_category_id') 2023-07-24T13:00:22.478480365Z [medusa-plugin-printful]: Failed getting category from Printful, skipping this operation! undefined 2023-07-24T13:00:22.853813234Z { 2023-07-24T13:00:22.853854304Z code: 404, 2023-07-24T13:00:22.853861524Z result: 'Not Found', 2023-07-24T13:00:22.853867739Z error: { reason: 'NotFound', message: 'Not Found' } 2023-07-24T13:00:22.853873788Z }

Note that error message is also an object. Should probably use error.message.

fsyntax commented 1 year ago

Thanks for the report! Going to fix it

fsyntax commented 1 year ago

Hey there! Finally got to look into it - should be resolved with v1.5.4 :)