@23blocks/angular 6.0.1 → 6.1.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/README.md +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -123,6 +123,9 @@ provideBlocks23({
|
|
|
123
123
|
|
|
124
124
|
// Optional: Token storage (default: 'localStorage')
|
|
125
125
|
storage: 'localStorage', // 'localStorage' | 'sessionStorage' | 'memory'
|
|
126
|
+
|
|
127
|
+
// Optional: Enable debug logging
|
|
128
|
+
debug: !environment.production,
|
|
126
129
|
})
|
|
127
130
|
```
|
|
128
131
|
|
|
@@ -460,12 +463,18 @@ currentUser$ = this.auth.getCurrentUser().pipe(
|
|
|
460
463
|
|
|
461
464
|
### Error Handling
|
|
462
465
|
|
|
466
|
+
Every error includes a unique request ID for easy debugging and support:
|
|
467
|
+
|
|
463
468
|
```typescript
|
|
464
469
|
import { isBlockErrorException, ErrorCodes } from '@23blocks/contracts';
|
|
465
470
|
|
|
466
471
|
this.auth.signIn({ email, password }).subscribe({
|
|
467
472
|
error: (err) => {
|
|
468
473
|
if (isBlockErrorException(err)) {
|
|
474
|
+
// Request tracing for debugging
|
|
475
|
+
console.log('Request ID:', err.requestId); // "req_m5abc_xyz123"
|
|
476
|
+
console.log('Duration:', err.duration); // 145 (ms)
|
|
477
|
+
|
|
469
478
|
switch (err.code) {
|
|
470
479
|
case ErrorCodes.INVALID_CREDENTIALS:
|
|
471
480
|
this.error = 'Invalid email or password';
|
|
@@ -479,6 +488,9 @@ this.auth.signIn({ email, password }).subscribe({
|
|
|
479
488
|
default:
|
|
480
489
|
this.error = err.message;
|
|
481
490
|
}
|
|
491
|
+
|
|
492
|
+
// Send request ID to support for debugging
|
|
493
|
+
// "Please check request req_m5abc_xyz123"
|
|
482
494
|
}
|
|
483
495
|
},
|
|
484
496
|
});
|
package/package.json
CHANGED