File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -786,8 +786,22 @@ export default function ClientPage() {
786786 }
787787
788788 setStatus ( "On-chain data refreshed" ) ;
789- } catch {
790- setError ( "Failed to fetch on-chain data." ) ;
789+ } catch ( err ) {
790+ const message =
791+ err instanceof Error
792+ ? err . message
793+ : typeof err === "string"
794+ ? err
795+ : "Unknown error" ;
796+
797+ // Common foot-gun: wallet on testnet while app is set to mainnet (or vice-versa).
798+ const networkHint =
799+ ( STACKS_NETWORK === "mainnet" && sender . startsWith ( "ST" ) ) ||
800+ ( STACKS_NETWORK === "testnet" && sender . startsWith ( "SP" ) )
801+ ? " (Wallet/network mismatch: switch Leather network to match the app.)"
802+ : "" ;
803+
804+ setError ( `Failed to fetch on-chain data: ${ message } ${ networkHint } ` ) ;
791805 } finally {
792806 setIsLoading ( false ) ;
793807 }
You can’t perform that action at this time.
0 commit comments