@markwharton/pwa-core 3.2.0 → 3.3.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/dist/server.d.ts CHANGED
@@ -235,10 +235,12 @@ export declare function initErrorHandling(config?: {
235
235
  * Initializes error handling from environment variables.
236
236
  * Currently a no-op but provides consistent API for future error config
237
237
  * (e.g., ERROR_LOG_LEVEL, ERROR_INCLUDE_STACK).
238
+ * @param callback - Optional callback invoked when handleFunctionError is called (fire-and-forget)
238
239
  * @example
239
240
  * initErrorHandlingFromEnv(); // Uses process.env automatically
241
+ * initErrorHandlingFromEnv((op, msg) => sendAlert(op, msg));
240
242
  */
241
- export declare function initErrorHandlingFromEnv(): void;
243
+ export declare function initErrorHandlingFromEnv(callback?: ErrorCallback): void;
242
244
  /**
243
245
  * Handles unexpected errors safely by logging details and returning a generic message.
244
246
  * Use in catch blocks to avoid exposing internal error details to clients.
package/dist/server.js CHANGED
@@ -360,12 +360,14 @@ function initErrorHandling(config = {}) {
360
360
  * Initializes error handling from environment variables.
361
361
  * Currently a no-op but provides consistent API for future error config
362
362
  * (e.g., ERROR_LOG_LEVEL, ERROR_INCLUDE_STACK).
363
+ * @param callback - Optional callback invoked when handleFunctionError is called (fire-and-forget)
363
364
  * @example
364
365
  * initErrorHandlingFromEnv(); // Uses process.env automatically
366
+ * initErrorHandlingFromEnv((op, msg) => sendAlert(op, msg));
365
367
  */
366
- function initErrorHandlingFromEnv() {
367
- // Future: read ERROR_LOG_LEVEL, ERROR_INCLUDE_STACK, etc.
368
- initErrorHandling({});
368
+ function initErrorHandlingFromEnv(callback) {
369
+ // Future: read ERROR_LOG_LEVEL, ERROR_INCLUDE_STACK, etc. from process.env
370
+ initErrorHandling({ callback });
369
371
  }
370
372
  /**
371
373
  * Handles unexpected errors safely by logging details and returning a generic message.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markwharton/pwa-core",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Shared patterns for Azure PWA projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",