fix: log cause property from the error (#9944)

Fixes: FRMW-2762

This PR fixes the error reporting to include the original error message and the error cause when logging it using the JSON formatter of Winston.

> Side note: There is still a lot of room for improvements in our logging. But that require a overhaul cleanup in multiple places and will require dedicated loggers for commands and APP and special treatment for pretty printing errors.

## Error output in JSON format

**Before**
![CleanShot 2024-11-06 at 13 12 32@2x](https://github.com/user-attachments/assets/a986d33c-9c30-45bc-816d-e9aa142ea097)

**After**
![CleanShot 2024-11-06 at 13 11 28@2x](https://github.com/user-attachments/assets/15430e55-40b3-4d1c-b91d-3b3b4f9d0d39)
This commit is contained in:
Harminder Virk
2024-11-06 15:43:54 +00:00
committed by GitHub
parent b3cbc160eb
commit c9a2b42252
4 changed files with 129 additions and 30 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/cli": patch
---
fix: log cause property from the error