@thead-vantage/react 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/AdBanner.tsx +13 -1
package/package.json
CHANGED
|
@@ -83,7 +83,19 @@ export function AdBanner({
|
|
|
83
83
|
}
|
|
84
84
|
} catch (err) {
|
|
85
85
|
console.error('[AdBanner] Error fetching ad:', err);
|
|
86
|
-
|
|
86
|
+
|
|
87
|
+
// For CORS errors, show user-friendly message but log technical details
|
|
88
|
+
if (err instanceof Error && err.message.includes('CORS error')) {
|
|
89
|
+
console.error('[AdBanner] CORS Error Details:', {
|
|
90
|
+
message: err.message,
|
|
91
|
+
note: 'This is a server-side configuration issue. The thead-vantage.com server needs to handle OPTIONS requests without redirecting. See CORS_CONFIGURATION.md for implementation details.',
|
|
92
|
+
});
|
|
93
|
+
// Show generic message to end users
|
|
94
|
+
setError('Ad unavailable');
|
|
95
|
+
} else {
|
|
96
|
+
// For other errors, show the error message
|
|
97
|
+
setError(err instanceof Error ? err.message : 'Failed to fetch ad');
|
|
98
|
+
}
|
|
87
99
|
} finally {
|
|
88
100
|
setLoading(false);
|
|
89
101
|
}
|