@clicktap/ui 0.18.11 → 0.19.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clicktap/ui",
3
- "version": "0.18.11",
3
+ "version": "0.19.0",
4
4
  "private": false,
5
5
  "author": "Clicktap",
6
6
  "description": "A library of React UI components and low-level hooks.",
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns a safe, user-facing error message.
3
+ *
4
+ * In development, logs the full error (including HTTP status when available)
5
+ * to the console. In all environments, returns the `fallback` string instead
6
+ * of leaking internal details to the UI.
7
+ */
8
+ export declare function getSafeErrorMessage(error: unknown, fallback?: string): string;
9
+ export default getSafeErrorMessage;
package/utils/error.js ADDED
@@ -0,0 +1 @@
1
+ import{isDevelopment as o}from"./env.js";const n="Something went wrong. Please try again later.";function i(e,s=n){if(o){const t=e!=null&&typeof e=="object"&&"response"in e&&typeof e.response=="object"?e.response?.status:void 0;console.error("[Request Error]",...t?[t]:[],e)}return s}export{i as default,i as getSafeErrorMessage};