UNPKG

@rxap/ngx-error

Version:

This package provides a comprehensive error handling solution for Angular applications, including interceptors, services, and UI components to display different types of errors in a user-friendly dialog. It supports handling of generic errors, HTTP errors

20 lines (19 loc) 926 B
import { HttpErrorResponse, HttpEventType } from '@angular/common/http'; export interface SimplifiedHttpErrorResponse extends Record<string, unknown> { url: string | null; message: string; name: string; status: number; statusText: string; headers: Record<string, string[]>; error: any; errorMessage: string; ok: boolean; type: HttpEventType.Response | HttpEventType.ResponseHeader; } export declare function SimplifyHttpErrorResponse(event: HttpErrorResponse): SimplifiedHttpErrorResponse; export declare function ExtractContextFromError(error: unknown): Record<string, Record<string, unknown>>; export declare function ExtractExtraFromError(error: unknown): {}; export declare function ExtractTagsFromError(error: unknown): {}; export declare function ExtractError(error: unknown): string | HttpErrorResponse | Error; export declare function PrintError(errorCandidate: unknown): void;