Releases: ressurectit/ng-error-handling
Releases · ressurectit/ng-error-handling
v16.0.1
v16.0.0
Features
- all interceptors now use updated
IGNORED_INTERCEPTORStoken, which works also with functions
BREAKING CHANGES
- minimal supported version of
Node.jsis20.19.0 - minimal supported version of
@angularpackages is20.3.2 - minimal supported version of
@angular/materialpackages is20.2.0 - minimal supported version of
@anglr/commonpackages is23.0.0
v15.0.1
v15.0.0
Features
- new
httpGatewayTimeoutInterceptorhttp interceptor function, which is used for intercepting http responses and handling 504 statuses - new
httpServerErrorInterceptorhttp interceptor function, which is used for handling http server errors with codes 500..599 and displaying of internal server error - new
noConnectionInterceptorhttp interceptor function, which is used for intercepting http responses and handling 0 statuses - new
serviceUnavailableInterceptorhttp interceptor function, which is used for intercepting http responses and handling 503 statuses - new
CatchHttpClientErrorHttpStatusCodeOptionsinterface, which represents options for cattch http client errors specific for http status code- properties
behaviorbehavior of catch http client error, default isCatchHttpClientErrorBehavior.SuppressskipErrorNotificationsindication whether skip displaying of notifications for errorsskipServerValidationErrorsindication whether skip server validation errors processingforceCustomMessageDisplayindication whether forcibly display custom message if present, not only as fallback but alwaysmessageobject storing default messages to be displayed for specific http status codes
- properties
- new
HttpClientErrorConfigstype, that is object storing specific options/config according status code - new
HTTP_CLIENT_ERROR_CONFIGSinjection token, that contains custom configs for http client error handlers for specific http status codes - new
provideHttpClientErrorConfigsprovider, which provides http client error handlers and merges them with existing provided handlers - updated
CatchHttpClientErrorOptionsinterface- new
configsproperty, with specific options/config for http status codes
- new
- updated
handleHttpClientErrorserror handler- now use new
configsproperty as priority for handling of errors
- now use new
- updated
handleHttp404Errorerror handler- now use new
configsproperty as priority for handling of errors
- now use new
- subpackage
@anglr/error-handling/rest- updated
RestCatchHttpClientErrorinterface- new
configsproperty, object storing options/config for specific http status codes
- new
- updated
HttpClientErrorBehaviordecorator- new parameter
statusCodeif specified, behavior will be set for specific http status code
- new parameter
- updated
HttpClientErrorForceCustomMessagedecorator- new parameter
statusCodeif specified, force custom message display will be set for specific http status code
- new parameter
- updated
HttpClientErrorSkipErrorNotificationsdecorator- new parameter
statusCodeif specified, skip error notifications will be set for specific http status code
- new parameter
- updated
HttpClientErrorSkipServerValidationErrorsdecorator- new parameter
statusCodeif specified, skip server validation errors will be set for specific http status code
- new parameter
- updated
BREAKING CHANGES
- removed
handle4xxFuncerror handler, use new ones - removed
handle400WithValidationsFuncerror handler, use new ones - removed
handle404Funcerror handler, use new ones - removed
handle4xxSuppressrxjs operator, use new ones - removed
handle4xxrxjs operator, use new ones - removed
handle400WithValidationsrxjs operator, use new ones - removed
handle404rxjs operator, use new ones - removed
handle404Suppressrxjs operator, use new ones - removed
Handle4xxOptionsinterface, use new ones - removed
XXXHttpClientErrorinterface, use new ones - removed
ClientValidationErrorclass, use new ones - removed
RestClientErrorclass, use new ones - removed
RestNotFoundErrorclass, use new ones - removed
HttpClientErrorCustomHandlertype - removed
HTTP_CLIENT_ERROR_MESSAGESinjection token, functionality moved intoHTTP_CLIENT_ERROR_CONFIGS - removed
provideHttpClientErrorMessagesprovider, functionality moved intoprovideHttpClientErrorConfigs - updated
CatchHttpClientErrorOptionsinterface- removed
messagesproperty, functionality moved intoconfigsproperty
- removed
- subpackage
@anglr/error-handling/rest- removed
ClientErrorHandlingBehaviorenum - removed
ClientErrorHandlingOptionsclass - removed
getDefaultClientErrorObservablefunction - removed
RestHttpClientErrorsinterface - removed
CLIENT_ERROR_HANDLING_MIDDLEWARE_OPTIONSinjection token - removed
HTTP_CLIENT_ERROR_CUSTOM_HANDLERinjection token - removed
HTTP_IGNORED_CLIENT_ERRORSinjection token, use one from base package - removed
HttpClientErrorCustomHandlerDeftype - removed
getErrorHandlersfunction - removed
ClientErrorHandlingMiddlewaremiddleware - removed
ErrorPassThroughdecorator - removed
ErrorPassThroughHttpdecorator - removed
Handle400WithValidationsdecorator - removed
Handle404decorator - removed
IgnoreClientErrorsdecorator - removed
SuppressErrordecorator - removed
WithRestClientErrordecorator - updated
RestCatchHttpClientErrorinterface- removed
messagesproperty, functionality moved intoconfigsproperty
- removed
- removed
v14.0.0
BREAKING CHANGES
- minimal supported version of
NodeJsis18 - minimal supported version of
@angularpackages is19.1.0 - minimal supported version of
@anglr/commonis22.0.0 - minimal supported version of
@jscrpt/commonis7.0.0 - minimal supported version of
tslibis2.8.1 - renamed
DialogInternalServerErrorSAComponentcomponent toDialogInternalServerErrorComponent - renamed
InternalServerErrorSAComponentcomponent toInternalServerErrorComponent
v13.0.0
Bug Fixes
- fixed
package.jsondefault export for material subpackage
Features
- new
HttpClientErrorHandlerstype, that is object storing error handlers for http client errors according status code - new
HttpClientErrorMessagestype, that is object storing error messages for http client errors according status code - new
provideAnglrExceptionExtendersfunction, that provides anglr exception extends functions - new
provideInternalServerErrorRendererfunction, that provides internal server error renderer type - new
DummyInternalServerErrorRendererservice, that is dummy renderer used for displaying/rendering internal server error - new
handleHttpClientErrorResponsefunction, that handles http error response with code 400..499 and returns HttpClientError, otherwise returns original http error response - new
handleHttpClientErrorsfunction, that handles http client errors according provided options - new
handleHttp404Errorfunction, that is custom handler for http 404 status codes - new
applyBehaviorfunction, that gets result of catch http client error according provided behavior - new
provideHttpClientErrorMessagesfunction, that provides http client error messages and merges them with existing provided messages - new
provideHttpClientErrorHandlersfunction, that provides http client error handlers and merges them with existing provided handlers - new
provideHttpClientErrorResponseMapperfunction, that provides http client error response mapper function - new
provideHttpClientValidationErrorResponseMapperfunction, that provides http client validation error response mapper function - new
processHttpClientErrorResponserxjs operator, that processes http client error response with code 400..499 and converts it into HttpClientError, otherwise throw original http error response - new
catchHttpClientErrorrxjs operator, that catches http client errors and handles them according provided options - new
CatchHttpClientErrorBehaviorenum, that is enumeration of available behavior for catch http client errorSuppresserror is processed, but observable never completesPassThroghhttpClientError object is returned as result of observableThrowhttpClientError object is 'thrown' as error from observable
- new
CatchHttpClientErrorOptionsinterface, that represents options for catch http client errors- properties
injectorinstance of injector used for obtaining dependenciesbehaviorbehavior of catch http client error, default isCatchHttpClientErrorBehavior.SuppressskipErrorNotificationsindication whether skip displaying of notifications for errorsskipServerValidationErrorsindication whether skip server validation errors processingforceCustomMessageDisplayindication whether forcibly display custom message if present, not only as fallback but alwaysmessagesobject storing default messages to be displayed for specific http status codeshandlersobject storing default error handlers for specific http status codes
- properties
- new
HttpClientErrorHandlerinterface, that represents function that is used for handling http client error according status code - new
HttpClientErrorOptionsinterface, that represents options used for common handling of client errors- properties
injectorinjector used for obtaining dependenciesclientErrorsResponseMapperresponse mapper for http client errorsclientValidationErrorsResponseMapperresponse mapper for http client validation errorsignoredHttpStatusCodesarray of ignored http status codes that will not be processed
- properties
- new
HttpClientErrorclass, that represents information about http client error (400..499)- properties
errorsarray of processed client errorsvalidationErrorsobject storing server valiation errorsstatusCodehttp status codemessagehttp error response messageresponsecomplete http error response object
- properties
- new
HttpNotFoundErrorclass, that represents information about http not found error (404) - new
HTTP_IGNORED_CLIENT_ERRORSinjection token, that contains array of http status codes that are ignored - new
HTTP_CLIENT_ERROR_MESSAGESinjection token that contains custom client error messages - new
HTTP_CLIENT_ERROR_HANDLERSinjection token that contains custom client error handlers - updated
InternalServerErrorSAComponentcomponent- is now standalone
- updated
HttpClientErrorResponseMappertype, return type is nowPromiseOr, supports async usage - updated
HttpClientValidationErrorResponseMappertype, return type is nowPromiseOr, supports async usage - subpackage
@anglr/error-handling/rest- new
HttpClientErrorProcessingMiddlewaremiddleware, that is used for processing http client errors (400..499) - new
CatchHttpClientErrorMiddlewaremiddleware, that catches http client error and handles according options - new
HttpClientErrorsMapperdecorator, that sets custom http client errors mapper function - new
HttpClientValidationErrorsMapperdecorator, that sets custom http client validation errors mapper function - new
IgnoredHttpErrorStatusCodesdecorator, that sets ignored http error status codes that will be ignored by http client error processing middleware - new
HttpClientErrorMessagesdecorator, that sets http client error messages - new
HttpClientErrorHandlersdecorator, that sets http client error handlers - new
HttpClientErrorBehaviordecorator, that sets http client error behavior - new
HttpClientErrorForceCustomMessagedecorator, that sets http client error to force custom message displaying - new
HttpClientErrorSkipErrorNotificationsdecorator, that sets http client error to skip error notifications - new
HttpClientErrorSkipServerValidationErrorsdecorator, that sets http client error to skip server validation errors - new
RestHttpClientErrorProcessinginterface, configuration that can be used within http client error processing middleware- properties
clientErrorsResponseMapperresponse mapper for http client errorsclientValidationErrorsResponseMapperresponse mapper for http client validation errorsignoredHttpStatusCodesarray of ignored http status codes that will not be processed
- properties
- new
RestCatchHttpClientErrorinterface, configuration that can be used within catch http client error middleware- properties
behaviorbehavior of catch http client error, default isCatchHttpClientErrorBehavior.SuppressskipErrorNotificationsindication whether skip displaying of notifications for errorsskipServerValidationErrorsindication whether skip server validation errors processingforceCustomMessageDisplayindication whether forcibly display custom message if present, not only as fallback but alwaysmessagesobject storing default messages to be displayed for specific http status codeshandlersobject storing default error handlers for specific http status codes
- properties
- new
- subpackage
@anglr/error-handling/material- updated
DialogInternalServerErrorSAComponentcomponent- is now standalone
- updated
BREAKING CHANGES
- minimal supported version of
NodeJsis18 - minimal supported version of
@angularis17.0.1 - minimal supported version of
@angularmaterial is17.0.0 - minimal supported version of
@jscrpt/commonis5.0.0 - minimal supported version of
@anglr/commonis19.0.0 - minimal supported version of
@anglr/restis14.0.0 - minimal supported version of
tslibis2.6.2 - removed
ERROR_WITH_URL_EXTENDERprovider, useprovideAnglrExceptionExtendersto provide it - removed
InternalServerErrorModule,InternalServerErrorSAComponentis now standalone - removed
ServerValidationsModule,ServerValidationValidatorSADirectiveis now standalone - renamed
InternalServerErrorComponenttoInternalServerErrorSAComponent - updated
readErrorsFromHttpErrorResponsefunction, is nowasync - subpackage
@anglr/error-handling/html2canvas- removed
ERROR_WITH_SCREENSHOT_EXTENDERprovider, useprovideAnglrExceptionExtendersto provide it
- removed
- subpackage
@anglr/error-handling/material- removed
DIALOG_INTERNAL_SERVER_ERROR_RENDERER_PROVIDERprovider, useprovideInternalServerErrorRendererto provide it - removed
DialogInternalServerErrorModule,DialogInternalServerErrorSAComponentis now standalone - renamed
DialogInternalServerErrorComponenttoDialogInternalServerErrorSAComponent
- removed
v12.0.1
v12.0.0
Bug Fixes
- fixed
Handle400WithValidationsdecorator, now correctly registers custom handler for 400 http status code
Features
- now also typings are available for external usage
- new
readErrorsFromHttpErrorResponsefunction, that reads errors and validation errors from http error response - new
HttpClientErrorsinterface, which represents definition of http client errors read from http error response- properties
errorsarray of errorvalidationErrorsobject storing validation errors
- properties
- new
HttpClientErrorinterface, which represents http client error, containing extracted errors and original- extends
HttpClientErrors
- properties
httpResponseoriginal http error response
- extends
- new
handle4xxSuppressrxjs operator, that handles http error response with code 400..499 as response and never returns - new
handle404Suppressrxjs operator, that handles 404 http code as response and never returns - updated
handle404rxjs operator function- new parameter
optionscontaining injector and mapper function for extraction of error messages
- new parameter
- subpackage
@anglr/error-handling/rest- new
ClientErrorHandlingBehaviorenum, which represents behavior for client error handling- values
Suppressresult of http request with client error is handled by handler but observable never finishesPassThroughresult of http request with client error is handled by handler and extracted errors passes through to observablePassThroughHttpresult of http request with client error is handled by handler and extracted errors passes through to observable with original http errorRestClientErrorresult of http request with client error is handled by handler and observable returns instance of RestClientError or its descendants
- values
- new
ClientErrorHandlingOptionsclass, which represents options for client error handling- properties
behaviorbehavior of client error handlingdefaultHandlerdefault error handler to be used if no other configured handler was founddefaultClientErrordefault factory for obtaining RestClientErrordefaultClientValidationErrordefault factory for obtaining ClientValidationError
- properties
- new
CLIENT_ERROR_HANDLING_MIDDLEWARE_OPTIONSinjection token for global client error handling middleware options - new
getDefaultClientErrorObservablefunction which, gets observable for error according specified behavior - new
HttpClientErrorCustomHandlerDeftype, that represents definition of http client error custom handler types - new
ErrorPassThroughdecorator, which changes behavior of ClientErrorHandlingMiddleware to pass through errors - new
ErrorPassThroughHttpdecorator, which changes behavior of ClientErrorHandlingMiddleware to pass through errors and http error response - new
SuppressErrordecorator, which changes behavior of ClientErrorHandlingMiddleware to suppress errors - new
WithRestClientErrordecorator, which changes behavior of ClientErrorHandlingMiddleware to rest client error - new
getErrorHandlersfunction, which gets error handler functions to be used for handling errors - updated
RestHttpClientErrorsinterface- new extends
Partial<ClientErrorHandlingMiddlewareOptions>
- new extends
- updated
HTTP_CLIENT_ERROR_CUSTOM_HANDLERinjection token- now of type
HttpClientErrorCustomHandlerDef
- now of type
- new
BREAKING CHANGES
- minimal supported version of
rxjsis7.5.7 - minimal supported version of
@jscrpt/commonis3.3.0 - minimal supported version of
@anglr/commonis15.0.1 - minimal supported version of
tslibis2.4.0 - updated
Handle4xxOptionsinterfaceinjectoris now optional
- removed
HttpClientErrorInterceptorhttp interceptor - removed
HTTP_CLIENT_ERROR_INTERCEPTOR_PROVIDERinjection token - removed
WithRestClientContextclass - removed
resolveWithRestClientContextfunction - removed
Handle400WithValidationsOptionsinterface, properties are now part ofHandle4xxOptions - renamed
ɵhandle4xxFunctionfunction tohandle4xxFunc - removed
handle4xxFuncoriginal function - renamed
ɵHandle400WithValidationsFunctionfunction tohandle400WithValidationsFunc - removed
handle400WithValidationsFuncoriginal function - moved
HTTP_IGNORED_CLIENT_ERRORSinto subpackage@anglr/error-handling/rest - moved
HTTP_CLIENT_ERROR_CUSTOM_HANDLERinto subpackage@anglr/error-handling/rest - updated
handle404Funcfunction- changed signature
- updated
HttpClientErrorCustomHandlertype- changed signature
v11.0.0
Features
- new
ERROR_HANDLING_REST_MIDDLEWARES_ORDERconstant, that represents definition of array of rest middlewares order including error handling middleware - new
middlewareTypestype, that represents array of middleware names that are available in error-handling library - new
REST_ERROR_HANDLING_MIDDLEWARE_ORDERprovider, that is provider for rest middleware order with error handling middleware - updated
ClientErrorHandlingMiddlewaremiddleware, now middleware type has staticidto correspond withRestMiddlewareType<RestMiddleware>
BREAKING CHANGES
- minimal supported version of
@angularis14.0.0 - minimal supported version of
@anglr/restis12.0.0 - minimal supported version of
@anglr/commonis11.2.0 - dropped support of
NodeJsversion12
v10.0.0
Features
- ERROR HANDLERS
- new
handle400WithValidationsFuncfunction, that handles http error response with code 400 and process validations errors and returns RestClientError or RestClientValidationError - new
handle404Funcfunction, that handles http error response with code 404 and returns RestNotFoundError - new
handle4xxFuncfunction, that handles http error response with code 400..499 and returns RestClientError
- new
- INTERCEPTORS
- new
HttpClientErrorInterceptorhttp interceptor, that is used for handling http server errors with codes 400..499 - new
HttpServerErrorInterceptorhttp interceptor, that is used for handling http server errors with codes 500..599 and displaying of internal server error - new
HTTP_SERVER_ERROR_INTERCEPTOR_PROVIDERprovider for proper use of HttpServerErrorInterceptor, use this provider to inject this interceptor - new
HTTP_CLIENT_ERROR_INTERCEPTOR_PROVIDERprovider for proper use of HttpClientErrorInterceptor, use this provider to inject this interceptor
- new
- new
HttpClientErrorResponseMappertype, that represents response mapper for http client errors that are converted to array of error messages - new
HttpClientValidationErrorResponseMappertype, that represents response mapper for http client validation errors that are converted into object RestClientValidationErrors - new
HttpClientErrorCustomHandlertype, that represents custom handler forHttpErrorResponse - new
HttpClientPropertyValidationErrorinterface, that represents validation errors for single validated property - new
HttpClientValidationErrorsinterface, that represents object storing validations errors from server - new
Handle4xxOptionsinterface, that options passed for handle 4xx http status codes- property
injectorinjector used for obtaining dependencies - property
clientErrorsResponseMapperresponse mapper for http client errors
- property
- new
Handle400WithValidationsOptionsinterface, that represents options passed for handle 400 http status code with validations- extends
Handle4xxOptions - property
clientValidationErrorsResponseMapperresponse mapper for http client validation errors
- extends
- new
RestClientErrorclass, that represents handled client error 4xx http status code - new
RestNotFoundErrorclass, that represents handled 404 http status code - new
ClientValidationErrorclass, that represents handled 400 http status code with validations - SERVER VALIDATIONS
ServerValidationServiceservice- new
serverValidationPropertiesproperty, that gets array of server validation properties - new
removeServerValidationErrormethod, that removes validation errors for single property
- new
ServerValidationValidatorDirectivedirective- now also tries to get property name from
FormControlNameDirective - now uses new
HttpClientValidationErrors, which allows multiple server validations errors to be set - new
propertyNameproperty, that is name of server property that is being validated by this
- now also tries to get property name from
- RXJS OPERATORS
- new
handle400WithValidationsoperator, that handles 400 http code with validations as response - new
handle404operator, that handles 404 http code as response - new
handle4xxoperator, that handles http error response with code 400..499 as response
- new
- new subpackage
@anglr/error-handling/rest - subpackage
@anglr/error-handling/rest- requires
@anglr/restminimal version11.0.1 - DECORATORS
- new
Handle404decorator, that handles 404 response http code - new
IgnoreClientErrorsdecorator, that adds ignored client error http codes for client error handling middleware - new
Handle400WithValidationsdecorator, that handles 400 http code with validations
- new
- MIDDLEWARES
- new
ClientErrorHandlingMiddlewaremiddleware, that is used for handling 4xx errors
- new
- new
RestHttpClientErrorsinterface, that contains metadata for http client errors configuration- property
addIgnoredClientErrorsarray of ignored client errors that will be added to default ones - property
clientErrorResponseMapperresponse mapper for client errors - property
customErrorHandlerscustom error handlers for specific http status codes
- property
- new
WithRestClientContextclass, that allows resolving your data with RESTClient context - new
resolveWithRestClientContextfunction, that resolves with rest client context into result
- requires
BREAKING CHANGES
- removed
BadRequestDetail - removed
HTTP_ERROR_INTERCEPTOR_PROVIDERreplaced byHTTP_SERVER_ERROR_INTERCEPTOR_PROVIDERandHTTP_CLIENT_ERROR_INTERCEPTOR_PROVIDERHTTP_CLIENT_ERROR_INTERCEPTOR_PROVIDERshould not be used, useClientErrorHandlingMiddlewareinstead
- removed
ResponseMapperFunction - removed
ERROR_RESPONSE_MAP_PROVIDER - removed
HttpErrorInterceptorreplaced byHttpClientErrorInterceptorandHttpServerErrorInterceptorHttpClientErrorInterceptorshould not be used, useClientErrorHandlingMiddlewareinstead
- removed
HttpErrorInterceptorOptions - updated
ServerValidationServiceclassserverValidationsproperty, has new typeHttpClientValidationErrors - updated
ServerValidationServiceclassaddServerValidationErrorsmethod, has new parameter typeHttpClientValidationErrors - removed
SERVER_VALIDATIONSconstant