Skip to content

Log error message and stack trace in SocialMediaService catch handlers#90

Closed
TaprootFreak wants to merge 67 commits into
d-EURO:developfrom
JuiceDollar:fix/socialmedia-logger-error-trace
Closed

Log error message and stack trace in SocialMediaService catch handlers#90
TaprootFreak wants to merge 67 commits into
d-EURO:developfrom
JuiceDollar:fix/socialmedia-logger-error-trace

Conversation

@TaprootFreak
Copy link
Copy Markdown

Summary

  • Passing an Error object as the second argument to NestJS's Logger.error() makes it interpret the error as trace: string. The logger then calls toString(), which only yields "Error: <msg>" and drops the actual stack.
  • That's why log lines like error [SocialMediaService]: Error while sending saving updates: appear without any detail — the real cause is silently lost.
  • Changes all six catch handlers to log ${e.message} in the message and pass e.stack as the trace argument.

Test plan

  • Confirm next SocialMediaService exception in jdm/jdt API logs on dfxdev/dfxprd includes the error message + stack

bernd2022 and others added 30 commits March 25, 2025 14:14
change coingecko api url
add savings to telegram service
Merge develop into main
Merge develop into main
[DEV-3836] New dEURO ambassador telegram message (#26)
New telegram/X messages
removed links in X posts
format currency with two minimum fraction digits
[NO-TASK]: Increase the number of records in ecosystem query (#42)
[NO-TASK] fix apollo errors (#44)
[NO-TASK]: DEPS price endpoint
[NO-TASK]: Add BTC quotes (#48)
[NO-TASK]: Social Media Updates
[NO-TASK] MinAmount for Saving and Bridge posts
feat: Add automatic fallback to dev.ponder.deuro.com when main Ponder…
fix: Track all dEURO mints including CoW Protocol swaps (#54)
* [NO-TASK]: Only mints from positions (d-EURO#61)

* [NO-TASK]: Fix Position mints query

* feat: Improve Ponder fallback mechanism with robust error handling (d-EURO#62)

* feat: Improve Ponder fallback mechanism with robust error handling

- Add dynamic URI resolution for immediate fallback activation
- Implement robust 503 detection checking multiple error structures
- Add automatic retry mechanism using forward() for failed operations
- Ensure all network errors trigger retry with fallback URL
- Align implementation with proven dApp fallback strategy

* [NO-TASK] improvements

---------

Co-authored-by: lapatric <42653152+lapatric@users.noreply.github.com>

---------

Co-authored-by: Danswar <48102227+Danswar@users.noreply.github.com>
Co-authored-by: Daniel Padrino <danswarrior1@gmail.com>
Co-authored-by: TaprootFreak <142087526+TaprootFreak@users.noreply.github.com>
TaprootFreak and others added 24 commits December 15, 2025 12:00
- Update @juicedollar/jusd to v1.0.6
- Use genesisPosition address from NPM package
- Fetch all position data from Ponder cache instead of hardcoded values
Require approval from @Danswar or @TaprootFreak for all PRs to protected branches.

Co-authored-by: Danswar <48102227+Danswar@users.noreply.github.com>
* fix: use real Coingecko prices for testnet tokens

- Add TESTNET_COINGECKO_MAPPING to map token symbols to Coingecko IDs
- WCBTC now fetches real Bitcoin price (~$100k) instead of fake $1
- Fixes incorrect collateralization display (was 0.01%, now ~200%)
- Fallback to $1 for stablecoins and unknown tokens

* fix: add null safety and improve error logging

* fix: return only USD from Coingecko, let updatePrices() calculate JUSD price

The 'eur' field is actually the price in JUSD (protocol stablecoin), not Euro.
By only returning USD, the correct JUSD price calculation in updatePrices()
is triggered: eur = usd / protocolStablecoinPrice

* chore: remove unused randRef variable

* Remove EUR/JUSD pricing complexity - use USD only

Since 1 JUSD = 1 USD (dollar stablecoin), there's no need for
currency conversion. This simplifies the pricing system:

- Remove /prices/eur endpoint from controller
- Remove getEuroPrice(), fetchEuroPrice() from service
- Remove euroPrice state variable
- Simplify PriceQueryCurrencies to just { usd?, btc? }
- Remove jusd calculations from ecosystem collateral stats

The API now works exclusively with USD, which is equivalent
to JUSD at 1:1 ratio.

* chore: use bitcoin ID for WBTC, remove dead code

* ci: add PR checks workflow for build and lint

* chore: rebrand d-EURO to JuiceDollar in telegram messages

* chore: update LICENSE copyright

* perf: skip Coingecko for JUSD - stablecoin is always $1

* fix: handle missing Coingecko price data gracefully

- Add explicit check for undefined price data on mainnet
- Use price?.usd checks instead of price === null
- Log warning when no price data available
- Prevents NaN calculations from undefined prices

* fix: prevent TypeError when poolSharesPrice is null
Deploy to both jdta and jdma container apps in DEV and PRD workflows.
* chore: bump version to 3.0.0 for mainnet release

* chore: trigger CI

* chore: update package-lock.json for 3.0.0

* chore: update lockfile
- rpc.citrea.xyz → rpc.citreascan.com
- rpc.testnet.citrea.xyz → rpc.testnet.citreascan.com
- explorer.mainnet.citrea.xyz → citreascan.com
- explorer.testnet.citrea.xyz → testnet.citreascan.com
* feat(positions): add GET /positions/reference endpoint for adjustPriceWithReference

* add GET /positions/best-cloneable endpoint
* chore: upgrade @juicedollar/jusd to 4.0.0

* update renamed ABI imports
* handle JUSD v3 contracts

* fix ABI selection for challenges

* per-version savings leadrate

* add contract version to tg msg

* backward-compatible savings rate

* use indexed mintingHubAddress

* refactor

* fix position version detection

* positions: derive minting update version from hub; add mintingHubAddress

* publish package v4.0.0

---------

Co-authored-by: Daniel Padrino <danswarrior1@gmail.com>
* Migrate CI/CD from Azure to server deploy

* Add explicit permissions block to workflows
When CONFIG_INDEXER_FALLBACK_URL is not set, activateFallback()
would switch to undefined as the Ponder URL, causing all GraphQL
queries to fail for 10 minutes after any transient network error.
Picks up EIP-55 checksum fix for testnet addresses
(savingsGateway, startUSD) that caused viem to reject
the addresses and fail all positionV2s updates.
Picks up EIP-55 checksum fix for testnet addresses
(savingsGateway, startUSD) that caused viem to reject
the addresses and fail all positionV2s updates.
@TaprootFreak
Copy link
Copy Markdown
Author

Wrong target, reopening on JuiceDollar/api fork

@TaprootFreak
Copy link
Copy Markdown
Author

Reopening — the same bug exists in both forks. This PR targets d-EURO, JuiceDollar#39 targets the JuiceDollar fork.

@TaprootFreak TaprootFreak reopened this Apr 17, 2026
@TaprootFreak
Copy link
Copy Markdown
Author

Closing — this cross-fork PR accidentally contained the full divergence between JuiceDollar/develop and d-EURO/develop, not just the logger fix. Will open a clean PR from d-EURO/api directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants