@rxap/ngx-error 19.0.0-dev.1 → 19.0.0-dev.2
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/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/compodoc/changelog.html +40 -0
- package/compodoc/components/AngularErrorComponent.html +9 -14
- package/compodoc/components/AnyHttpErrorComponent.html +17 -23
- package/compodoc/components/CodeHttpErrorComponent.html +12 -17
- package/compodoc/components/ErrorDialogComponent.html +21 -26
- package/compodoc/components/MessageHttpErrorComponent.html +12 -17
- package/compodoc/components/OpenApiHttpResponseErrorComponent.html +525 -0
- package/compodoc/dependencies.html +12 -10
- package/compodoc/fonts/ionicons.svg +698 -698
- package/compodoc/graph/dependencies.svg +1 -1
- package/compodoc/images/compodoc-vectorise-inverted.svg +16 -15
- package/compodoc/images/compodoc-vectorise.svg +16 -15
- package/compodoc/index.html +1 -1
- package/compodoc/injectables/AnyHttpErrorService.html +12 -4
- package/compodoc/injectables/OpenApiHttpResponseErrorService.html +572 -0
- package/compodoc/injectables/RxapErrorHandler.html +103 -8
- package/compodoc/interfaces/AnyHttpErrorDialogData.html +194 -6
- package/compodoc/interfaces/ErrorHandlerOptions.html +24 -2
- package/compodoc/interfaces/IErrorDialogComponent.html +10 -11
- package/compodoc/interfaces/OpenApiHttpResponseErrorDialogData.html +378 -0
- package/compodoc/interfaces/SimplifiedHttpErrorResponse.html +86 -1
- package/compodoc/js/menu-wc.js +9 -0
- package/compodoc/js/menu-wc_es5.js +2 -2
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/overview.html +3 -3
- package/compodoc/properties.html +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AngularErrorComponent.html +2 -2
- package/docs/classes/AngularErrorService.html +2 -2
- package/docs/classes/AnyHttpErrorComponent.html +2 -2
- package/docs/classes/AnyHttpErrorService.html +2 -2
- package/docs/classes/CodeHttpErrorComponent.html +2 -2
- package/docs/classes/CodeHttpErrorService.html +2 -2
- package/docs/classes/ErrorCaptureService.html +2 -2
- package/docs/classes/ErrorDialogComponent.html +2 -2
- package/docs/classes/MessageHttpErrorComponent.html +2 -2
- package/docs/classes/MessageHttpErrorService.html +2 -2
- package/docs/classes/OpenApiHttpResponseErrorComponent.html +4 -0
- package/docs/classes/OpenApiHttpResponseErrorService.html +6 -0
- package/docs/classes/RxapErrorHandler.html +4 -3
- package/docs/documentation.json +3558 -1825
- package/docs/functions/DefaultErrorCodeExtractor.html +1 -1
- package/docs/functions/DefaultErrorFilter.html +1 -1
- package/docs/functions/ExtractContextFromError.html +1 -1
- package/docs/functions/ExtractError.html +1 -1
- package/docs/functions/ExtractExtraFromError.html +1 -1
- package/docs/functions/ExtractTagsFromError.html +1 -1
- package/docs/functions/HttpErrorInterceptor.html +1 -1
- package/docs/functions/PrintError.html +1 -1
- package/docs/functions/ProvideErrorHandler.html +1 -1
- package/docs/functions/SimplifyHttpErrorResponse.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/AngularErrorDialogData.html +2 -2
- package/docs/interfaces/AnyHttpErrorDialogData.html +12 -2
- package/docs/interfaces/CodeHttpErrorDialogData.html +12 -2
- package/docs/interfaces/ErrorHandlerOptions.html +2 -2
- package/docs/interfaces/ErrorInterceptorOptions.html +2 -2
- package/docs/interfaces/IErrorDialogComponent.html +2 -2
- package/docs/interfaces/MessageHttpErrorDialogData.html +12 -2
- package/docs/interfaces/OpenApiHttpResponseErrorDialogData.html +24 -0
- package/docs/interfaces/SimplifiedHttpErrorResponse.html +4 -2
- package/docs/modules.html +3 -0
- package/docs/variables/RXAP_ERROR_DIALOG_COMPONENT.html +1 -1
- package/docs/variables/RXAP_ERROR_DIALOG_DATA.html +1 -1
- package/docs/variables/RXAP_ERROR_DIALOG_ERROR.html +1 -1
- package/docs/variables/RXAP_ERROR_HANDLER_OPTIONS.html +1 -1
- package/docs/variables/RXAP_ERROR_INTERCEPTOR_OPTIONS.html +1 -1
- package/package.json +33 -34
- package/theme.css +376 -1
|
@@ -164,6 +164,10 @@
|
|
|
164
164
|
<span class="modifier">Protected</span>
|
|
165
165
|
<a href="#showAngularErrorDialog" >showAngularErrorDialog</a>
|
|
166
166
|
</li>
|
|
167
|
+
<li>
|
|
168
|
+
<span class="modifier">Protected</span>
|
|
169
|
+
<a href="#showOpenApiHttpResponseErrorDialog" >showOpenApiHttpResponseErrorDialog</a>
|
|
170
|
+
</li>
|
|
167
171
|
</ul>
|
|
168
172
|
</td>
|
|
169
173
|
</tr>
|
|
@@ -204,8 +208,8 @@
|
|
|
204
208
|
|
|
205
209
|
<tr>
|
|
206
210
|
<td class="col-md-4">
|
|
207
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
208
|
-
class="link-to-prism">src/lib/error-handler.ts:
|
|
211
|
+
<div class="io-line">Defined in <a href="" data-line="69"
|
|
212
|
+
class="link-to-prism">src/lib/error-handler.ts:69</a></div>
|
|
209
213
|
</td>
|
|
210
214
|
</tr>
|
|
211
215
|
|
|
@@ -271,8 +275,8 @@
|
|
|
271
275
|
|
|
272
276
|
<tr>
|
|
273
277
|
<td class="col-md-4">
|
|
274
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
275
|
-
class="link-to-prism">src/lib/error-handler.ts:
|
|
278
|
+
<div class="io-line">Defined in <a href="" data-line="157"
|
|
279
|
+
class="link-to-prism">src/lib/error-handler.ts:157</a></div>
|
|
276
280
|
</td>
|
|
277
281
|
</tr>
|
|
278
282
|
|
|
@@ -318,6 +322,75 @@
|
|
|
318
322
|
</tr>
|
|
319
323
|
</tbody>
|
|
320
324
|
</table>
|
|
325
|
+
<table class="table table-sm table-bordered">
|
|
326
|
+
<tbody>
|
|
327
|
+
<tr>
|
|
328
|
+
<td class="col-md-4">
|
|
329
|
+
<a name="showOpenApiHttpResponseErrorDialog"></a>
|
|
330
|
+
<span class="name">
|
|
331
|
+
<span class="modifier">Protected</span>
|
|
332
|
+
<span ><b>showOpenApiHttpResponseErrorDialog</b></span>
|
|
333
|
+
<a href="#showOpenApiHttpResponseErrorDialog"><span class="icon ion-ios-link"></span></a>
|
|
334
|
+
</span>
|
|
335
|
+
</td>
|
|
336
|
+
</tr>
|
|
337
|
+
<tr>
|
|
338
|
+
<td class="col-md-4">
|
|
339
|
+
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
340
|
+
<code>showOpenApiHttpResponseErrorDialog(data: <a href="../interfaces/OpenApiHttpResponseErrorDialogData.html" target="_self">OpenApiHttpResponseErrorDialogData</a>)</code>
|
|
341
|
+
</td>
|
|
342
|
+
</tr>
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
<tr>
|
|
346
|
+
<td class="col-md-4">
|
|
347
|
+
<div class="io-line">Defined in <a href="" data-line="151"
|
|
348
|
+
class="link-to-prism">src/lib/error-handler.ts:151</a></div>
|
|
349
|
+
</td>
|
|
350
|
+
</tr>
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
<tr>
|
|
354
|
+
<td class="col-md-4">
|
|
355
|
+
|
|
356
|
+
<div class="io-description">
|
|
357
|
+
<b>Parameters :</b>
|
|
358
|
+
|
|
359
|
+
<table class="params">
|
|
360
|
+
<thead>
|
|
361
|
+
<tr>
|
|
362
|
+
<td>Name</td>
|
|
363
|
+
<td>Type</td>
|
|
364
|
+
<td>Optional</td>
|
|
365
|
+
</tr>
|
|
366
|
+
</thead>
|
|
367
|
+
<tbody>
|
|
368
|
+
<tr>
|
|
369
|
+
<td>data</td>
|
|
370
|
+
<td>
|
|
371
|
+
<code><a href="../interfaces/OpenApiHttpResponseErrorDialogData.html" target="_self" >OpenApiHttpResponseErrorDialogData</a></code>
|
|
372
|
+
</td>
|
|
373
|
+
|
|
374
|
+
<td>
|
|
375
|
+
No
|
|
376
|
+
</td>
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
</tr>
|
|
380
|
+
</tbody>
|
|
381
|
+
</table>
|
|
382
|
+
</div>
|
|
383
|
+
<div class="io-description">
|
|
384
|
+
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
|
385
|
+
|
|
386
|
+
</div>
|
|
387
|
+
<div class="io-description">
|
|
388
|
+
|
|
389
|
+
</div>
|
|
390
|
+
</td>
|
|
391
|
+
</tr>
|
|
392
|
+
</tbody>
|
|
393
|
+
</table>
|
|
321
394
|
</section>
|
|
322
395
|
<section data-compodoc="block-properties">
|
|
323
396
|
|
|
@@ -344,7 +417,7 @@
|
|
|
344
417
|
</tr>
|
|
345
418
|
<tr>
|
|
346
419
|
<td class="col-md-4">
|
|
347
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
420
|
+
<div class="io-line">Defined in <a href="" data-line="64" class="link-to-prism">src/lib/error-handler.ts:64</a></div>
|
|
348
421
|
</td>
|
|
349
422
|
</tr>
|
|
350
423
|
|
|
@@ -390,7 +463,7 @@
|
|
|
390
463
|
</tr>
|
|
391
464
|
<tr>
|
|
392
465
|
<td class="col-md-4">
|
|
393
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
466
|
+
<div class="io-line">Defined in <a href="" data-line="49" class="link-to-prism">src/lib/error-handler.ts:49</a></div>
|
|
394
467
|
</td>
|
|
395
468
|
</tr>
|
|
396
469
|
|
|
@@ -419,15 +492,19 @@ import {
|
|
|
419
492
|
IsNotReleaseVersion,
|
|
420
493
|
RXAP_ENVIRONMENT,
|
|
421
494
|
} from '@rxap/environment';
|
|
495
|
+
import { OpenApiHttpResponseError } from '@rxap/open-api';
|
|
422
496
|
import * as Sentry from '@sentry/angular';
|
|
423
497
|
import { AngularErrorDialogData } from './error/angular-error-dialog-data';
|
|
424
498
|
import { AngularErrorService } from './error/angular-error.service';
|
|
499
|
+
import { OpenApiHttpResponseErrorDialogData } from './open-api-http-response-error/open-api-http-response-error-dialog-data';
|
|
500
|
+
import { OpenApiHttpResponseErrorService } from './open-api-http-response-error/open-api-http-response-error.service';
|
|
425
501
|
import {
|
|
426
502
|
ExtractContextFromError,
|
|
427
503
|
ExtractError,
|
|
428
504
|
ExtractExtraFromError,
|
|
429
505
|
ExtractTagsFromError,
|
|
430
506
|
PrintError,
|
|
507
|
+
SimplifyHttpErrorResponse,
|
|
431
508
|
} from './utilities';
|
|
432
509
|
|
|
433
510
|
export interface ErrorHandlerOptions {
|
|
@@ -529,14 +606,32 @@ export class RxapErrorHandler implements ErrorHandler {
|
|
|
529
606
|
data.name = extractedError.name;
|
|
530
607
|
}
|
|
531
608
|
|
|
532
|
-
if (
|
|
533
|
-
this.
|
|
609
|
+
if (extractedError instanceof OpenApiHttpResponseError) {
|
|
610
|
+
this.showOpenApiHttpResponseErrorDialog({
|
|
611
|
+
...data,
|
|
612
|
+
...SimplifyHttpErrorResponse(extractedError.httpErrorResponse),
|
|
613
|
+
timestamp: Date.now(),
|
|
614
|
+
metadata: extractedError.metadata,
|
|
615
|
+
method: !extractedError.metadata.operation || typeof extractedError.metadata.operation === 'string' ? 'unknown' : extractedError.metadata.operation.method,
|
|
616
|
+
operationId: extractedError.operationId,
|
|
617
|
+
serverId: extractedError.serverId
|
|
618
|
+
});
|
|
619
|
+
} else {
|
|
620
|
+
if (data.message !== nonMessage) {
|
|
621
|
+
this.showAngularErrorDialog(data);
|
|
622
|
+
}
|
|
534
623
|
}
|
|
535
624
|
|
|
536
625
|
}
|
|
537
626
|
|
|
538
627
|
}
|
|
539
628
|
|
|
629
|
+
protected showOpenApiHttpResponseErrorDialog(data: OpenApiHttpResponseErrorDialogData): void {
|
|
630
|
+
runInInjectionContext(this.injector, () => {
|
|
631
|
+
inject(OpenApiHttpResponseErrorService).push(data);
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
|
|
540
635
|
protected showAngularErrorDialog(data: AngularErrorDialogData): void {
|
|
541
636
|
runInInjectionContext(this.injector, () => {
|
|
542
637
|
inject(AngularErrorService).push(data);
|
|
@@ -177,6 +177,19 @@
|
|
|
177
177
|
name
|
|
178
178
|
</a>
|
|
179
179
|
</li>
|
|
180
|
+
<li>
|
|
181
|
+
<a href="#ok"
|
|
182
|
+
>
|
|
183
|
+
ok
|
|
184
|
+
</a>
|
|
185
|
+
</li>
|
|
186
|
+
<li>
|
|
187
|
+
<span class="modifier">Optional</span>
|
|
188
|
+
<a href="#stack"
|
|
189
|
+
>
|
|
190
|
+
stack
|
|
191
|
+
</a>
|
|
192
|
+
</li>
|
|
180
193
|
<li>
|
|
181
194
|
<a href="#status"
|
|
182
195
|
>
|
|
@@ -195,6 +208,12 @@
|
|
|
195
208
|
timestamp
|
|
196
209
|
</a>
|
|
197
210
|
</li>
|
|
211
|
+
<li>
|
|
212
|
+
<a href="#type"
|
|
213
|
+
>
|
|
214
|
+
type
|
|
215
|
+
</a>
|
|
216
|
+
</li>
|
|
198
217
|
<li>
|
|
199
218
|
<a href="#url"
|
|
200
219
|
>
|
|
@@ -264,7 +283,7 @@
|
|
|
264
283
|
</tr>
|
|
265
284
|
<tr>
|
|
266
285
|
<td class="col-md-4">
|
|
267
|
-
<code>error:
|
|
286
|
+
<code>error: <code>any | null</code>
|
|
268
287
|
</code>
|
|
269
288
|
</td>
|
|
270
289
|
</tr>
|
|
@@ -272,7 +291,7 @@
|
|
|
272
291
|
|
|
273
292
|
<tr>
|
|
274
293
|
<td class="col-md-4">
|
|
275
|
-
<i>Type : </i>
|
|
294
|
+
<i>Type : </i> <code>any | null</code>
|
|
276
295
|
|
|
277
296
|
</td>
|
|
278
297
|
</tr>
|
|
@@ -314,6 +333,12 @@
|
|
|
314
333
|
|
|
315
334
|
|
|
316
335
|
|
|
336
|
+
<tr>
|
|
337
|
+
<td class="col-md-4">
|
|
338
|
+
<div class="io-description"><p>All response headers.</p>
|
|
339
|
+
</div>
|
|
340
|
+
</td>
|
|
341
|
+
</tr>
|
|
317
342
|
</tbody>
|
|
318
343
|
</table>
|
|
319
344
|
<table class="table table-sm table-bordered">
|
|
@@ -413,6 +438,83 @@
|
|
|
413
438
|
|
|
414
439
|
|
|
415
440
|
|
|
441
|
+
</tbody>
|
|
442
|
+
</table>
|
|
443
|
+
<table class="table table-sm table-bordered">
|
|
444
|
+
<tbody>
|
|
445
|
+
<tr>
|
|
446
|
+
<td class="col-md-4">
|
|
447
|
+
<a name="ok"></a>
|
|
448
|
+
<span class="name "><b>ok</b>
|
|
449
|
+
<a href="#ok">
|
|
450
|
+
<span class="icon ion-ios-link"></span>
|
|
451
|
+
</a>
|
|
452
|
+
</span>
|
|
453
|
+
</td>
|
|
454
|
+
</tr>
|
|
455
|
+
<tr>
|
|
456
|
+
<td class="col-md-4">
|
|
457
|
+
<code>ok: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
458
|
+
</code>
|
|
459
|
+
</td>
|
|
460
|
+
</tr>
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
<tr>
|
|
464
|
+
<td class="col-md-4">
|
|
465
|
+
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
466
|
+
|
|
467
|
+
</td>
|
|
468
|
+
</tr>
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
<tr>
|
|
475
|
+
<td class="col-md-4">
|
|
476
|
+
<div class="io-description"><p>Whether the status code falls in the 2xx range.</p>
|
|
477
|
+
</div>
|
|
478
|
+
</td>
|
|
479
|
+
</tr>
|
|
480
|
+
</tbody>
|
|
481
|
+
</table>
|
|
482
|
+
<table class="table table-sm table-bordered">
|
|
483
|
+
<tbody>
|
|
484
|
+
<tr>
|
|
485
|
+
<td class="col-md-4">
|
|
486
|
+
<a name="stack"></a>
|
|
487
|
+
<span class="name "><b>stack</b>
|
|
488
|
+
<a href="#stack">
|
|
489
|
+
<span class="icon ion-ios-link"></span>
|
|
490
|
+
</a>
|
|
491
|
+
</span>
|
|
492
|
+
</td>
|
|
493
|
+
</tr>
|
|
494
|
+
<tr>
|
|
495
|
+
<td class="col-md-4">
|
|
496
|
+
<code>stack: <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
497
|
+
</code>
|
|
498
|
+
</td>
|
|
499
|
+
</tr>
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
<tr>
|
|
503
|
+
<td class="col-md-4">
|
|
504
|
+
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
505
|
+
|
|
506
|
+
</td>
|
|
507
|
+
</tr>
|
|
508
|
+
|
|
509
|
+
<tr>
|
|
510
|
+
<td class="col-md-4">
|
|
511
|
+
<i>Optional</i>
|
|
512
|
+
</td>
|
|
513
|
+
</tr>
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
416
518
|
</tbody>
|
|
417
519
|
</table>
|
|
418
520
|
<table class="table table-sm table-bordered">
|
|
@@ -446,6 +548,12 @@
|
|
|
446
548
|
|
|
447
549
|
|
|
448
550
|
|
|
551
|
+
<tr>
|
|
552
|
+
<td class="col-md-4">
|
|
553
|
+
<div class="io-description"><p>Response status code.</p>
|
|
554
|
+
</div>
|
|
555
|
+
</td>
|
|
556
|
+
</tr>
|
|
449
557
|
</tbody>
|
|
450
558
|
</table>
|
|
451
559
|
<table class="table table-sm table-bordered">
|
|
@@ -479,6 +587,13 @@
|
|
|
479
587
|
|
|
480
588
|
|
|
481
589
|
|
|
590
|
+
<tr>
|
|
591
|
+
<td class="col-md-4">
|
|
592
|
+
<div class="io-description"><p>Textual description of response status code, defaults to OK.</p>
|
|
593
|
+
<p>Do not depend on this.</p>
|
|
594
|
+
</div>
|
|
595
|
+
</td>
|
|
596
|
+
</tr>
|
|
482
597
|
</tbody>
|
|
483
598
|
</table>
|
|
484
599
|
<table class="table table-sm table-bordered">
|
|
@@ -512,6 +627,45 @@
|
|
|
512
627
|
|
|
513
628
|
|
|
514
629
|
|
|
630
|
+
</tbody>
|
|
631
|
+
</table>
|
|
632
|
+
<table class="table table-sm table-bordered">
|
|
633
|
+
<tbody>
|
|
634
|
+
<tr>
|
|
635
|
+
<td class="col-md-4">
|
|
636
|
+
<a name="type"></a>
|
|
637
|
+
<span class="name "><b>type</b>
|
|
638
|
+
<a href="#type">
|
|
639
|
+
<span class="icon ion-ios-link"></span>
|
|
640
|
+
</a>
|
|
641
|
+
</span>
|
|
642
|
+
</td>
|
|
643
|
+
</tr>
|
|
644
|
+
<tr>
|
|
645
|
+
<td class="col-md-4">
|
|
646
|
+
<code>type: <code>HttpEventType.Response | HttpEventType.ResponseHeader</code>
|
|
647
|
+
</code>
|
|
648
|
+
</td>
|
|
649
|
+
</tr>
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
<tr>
|
|
653
|
+
<td class="col-md-4">
|
|
654
|
+
<i>Type : </i> <code>HttpEventType.Response | HttpEventType.ResponseHeader</code>
|
|
655
|
+
|
|
656
|
+
</td>
|
|
657
|
+
</tr>
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
<tr>
|
|
664
|
+
<td class="col-md-4">
|
|
665
|
+
<div class="io-description"><p>Type of the response, narrowed to either the full response or the header.</p>
|
|
666
|
+
</div>
|
|
667
|
+
</td>
|
|
668
|
+
</tr>
|
|
515
669
|
</tbody>
|
|
516
670
|
</table>
|
|
517
671
|
<table class="table table-sm table-bordered">
|
|
@@ -545,6 +699,12 @@
|
|
|
545
699
|
|
|
546
700
|
|
|
547
701
|
|
|
702
|
+
<tr>
|
|
703
|
+
<td class="col-md-4">
|
|
704
|
+
<div class="io-description"><p>URL of the resource retrieved, or null if not available.</p>
|
|
705
|
+
</div>
|
|
706
|
+
</td>
|
|
707
|
+
</tr>
|
|
548
708
|
</tbody>
|
|
549
709
|
</table>
|
|
550
710
|
</section>
|
|
@@ -552,17 +712,45 @@
|
|
|
552
712
|
|
|
553
713
|
|
|
554
714
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
555
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">
|
|
715
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
716
|
+
HttpEventType,
|
|
717
|
+
HttpHeaders,
|
|
718
|
+
} from '@angular/common/http';
|
|
719
|
+
|
|
720
|
+
export interface AnyHttpErrorDialogData {
|
|
556
721
|
method: string;
|
|
557
722
|
body?: any;
|
|
558
|
-
|
|
723
|
+
stack?: string;
|
|
724
|
+
error: any | null;
|
|
559
725
|
message: string;
|
|
560
726
|
name: string;
|
|
727
|
+
timestamp: number;
|
|
728
|
+
/**
|
|
729
|
+
* All response headers.
|
|
730
|
+
*/
|
|
731
|
+
headers: Record<string, string[]>;
|
|
732
|
+
/**
|
|
733
|
+
* Response status code.
|
|
734
|
+
*/
|
|
561
735
|
status: number;
|
|
736
|
+
/**
|
|
737
|
+
* Textual description of response status code, defaults to OK.
|
|
738
|
+
*
|
|
739
|
+
* Do not depend on this.
|
|
740
|
+
*/
|
|
562
741
|
statusText: string;
|
|
742
|
+
/**
|
|
743
|
+
* URL of the resource retrieved, or null if not available.
|
|
744
|
+
*/
|
|
563
745
|
url: string | null;
|
|
564
|
-
|
|
565
|
-
|
|
746
|
+
/**
|
|
747
|
+
* Whether the status code falls in the 2xx range.
|
|
748
|
+
*/
|
|
749
|
+
ok: boolean;
|
|
750
|
+
/**
|
|
751
|
+
* Type of the response, narrowed to either the full response or the header.
|
|
752
|
+
*/
|
|
753
|
+
type: HttpEventType.Response | HttpEventType.ResponseHeader;
|
|
566
754
|
}
|
|
567
755
|
</code></pre>
|
|
568
756
|
</div>
|
|
@@ -307,15 +307,19 @@ import {
|
|
|
307
307
|
IsNotReleaseVersion,
|
|
308
308
|
RXAP_ENVIRONMENT,
|
|
309
309
|
} from '@rxap/environment';
|
|
310
|
+
import { OpenApiHttpResponseError } from '@rxap/open-api';
|
|
310
311
|
import * as Sentry from '@sentry/angular';
|
|
311
312
|
import { AngularErrorDialogData } from './error/angular-error-dialog-data';
|
|
312
313
|
import { AngularErrorService } from './error/angular-error.service';
|
|
314
|
+
import { OpenApiHttpResponseErrorDialogData } from './open-api-http-response-error/open-api-http-response-error-dialog-data';
|
|
315
|
+
import { OpenApiHttpResponseErrorService } from './open-api-http-response-error/open-api-http-response-error.service';
|
|
313
316
|
import {
|
|
314
317
|
ExtractContextFromError,
|
|
315
318
|
ExtractError,
|
|
316
319
|
ExtractExtraFromError,
|
|
317
320
|
ExtractTagsFromError,
|
|
318
321
|
PrintError,
|
|
322
|
+
SimplifyHttpErrorResponse,
|
|
319
323
|
} from './utilities';
|
|
320
324
|
|
|
321
325
|
export interface ErrorHandlerOptions {
|
|
@@ -417,14 +421,32 @@ export class RxapErrorHandler implements ErrorHandler {
|
|
|
417
421
|
data.name = extractedError.name;
|
|
418
422
|
}
|
|
419
423
|
|
|
420
|
-
if (
|
|
421
|
-
this.
|
|
424
|
+
if (extractedError instanceof OpenApiHttpResponseError) {
|
|
425
|
+
this.showOpenApiHttpResponseErrorDialog({
|
|
426
|
+
...data,
|
|
427
|
+
...SimplifyHttpErrorResponse(extractedError.httpErrorResponse),
|
|
428
|
+
timestamp: Date.now(),
|
|
429
|
+
metadata: extractedError.metadata,
|
|
430
|
+
method: !extractedError.metadata.operation || typeof extractedError.metadata.operation === 'string' ? 'unknown' : extractedError.metadata.operation.method,
|
|
431
|
+
operationId: extractedError.operationId,
|
|
432
|
+
serverId: extractedError.serverId
|
|
433
|
+
});
|
|
434
|
+
} else {
|
|
435
|
+
if (data.message !== nonMessage) {
|
|
436
|
+
this.showAngularErrorDialog(data);
|
|
437
|
+
}
|
|
422
438
|
}
|
|
423
439
|
|
|
424
440
|
}
|
|
425
441
|
|
|
426
442
|
}
|
|
427
443
|
|
|
444
|
+
protected showOpenApiHttpResponseErrorDialog(data: OpenApiHttpResponseErrorDialogData): void {
|
|
445
|
+
runInInjectionContext(this.injector, () => {
|
|
446
|
+
inject(OpenApiHttpResponseErrorService).push(data);
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
|
|
428
450
|
protected showAngularErrorDialog(data: AngularErrorDialogData): void {
|
|
429
451
|
runInInjectionContext(this.injector, () => {
|
|
430
452
|
inject(AngularErrorService).push(data);
|
|
@@ -230,17 +230,16 @@ export interface IErrorDialogComponent<Error = any> {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
@Component({
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
],
|
|
233
|
+
selector: 'rxap-error-dialog',
|
|
234
|
+
templateUrl: './error-dialog.component.html',
|
|
235
|
+
styleUrls: ['./error-dialog.component.scss'],
|
|
236
|
+
changeDetection: ChangeDetectionStrategy.Default,
|
|
237
|
+
imports: [
|
|
238
|
+
NgIf,
|
|
239
|
+
NgClass,
|
|
240
|
+
NgForOf,
|
|
241
|
+
PortalModule,
|
|
242
|
+
]
|
|
244
243
|
})
|
|
245
244
|
export class ErrorDialogComponent implements AfterViewInit {
|
|
246
245
|
|