![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
angular-invocation-handler
Advanced tools
Enables general error handling and logging which allows to log errors, e.g for automatically sending back to the backend or for showing to the user
A module for collecting errors, stack traces and other information globally from within your Angular app e.g. for saving to a remote service or for displaying
Feel free to donate
![]()
Or donate Bitcoins:
Also via greenaddress
It's anyoing to handle all errors in controller and service and also very defective. So instead of surfacing the log it would be cool to manage them at a central place and maybe store them via on a backend service
Install this module:
bower install angular-invocation-handler --save
Add the dependencies
/*global app: true*/
var app = angular.module('resourcesApp', [
...
'ngIH.core',
'ngIH.ui' /* optional */,
'ngIH.exceptionHandler' /* optional */
]);
If you like to display the error message within your app, also include the ui module.
Configure the service to be handled:
app.config(function ($provide, ngIHServiceProvider, ngIHConfig) {
'use strict';
// enable UI feedback attach, default false
ngIHConfig.feedbackAttach = true;
// enable clearing of feedback
ngIHConfig.feedbackClear = true;
// set custom selector for appending UI error display element
ngIHConfig.uiSelector = '.navbar';
// enable scrolling to error display element
ngIHConfig.scrollToError = true;
// redirect to static error pages, e.g. 404 --> /404.html, default false
ngIHConfig.redirect = true;
// adding custom error handler, default is disabled
ngIHConfig.customErrorHandler = 'errorHandlingService';
// decorate the mentioned [services] with automatic error handling.
ngIHServiceProvider.decorate($provide, ['eventService']);
});
The customized error handling service looks like this:
app.factory('errorHandlingService', function ($log, $translate, blockUI) {
'use strict';
function buildValidationMessages(error, msg, callback, i) {
var errorDetails = error.data[i];
$translate('VALIDATION_ERROR_' + errorDetails.messageTemplate).then(function (translatedValue) {
msg = msg + ' ' + translatedValue;
// replace placeholder if set
if (errorDetails.propertyList) {
msg = msg.format(errorDetails.propertyList);
}
// callback when complete
if (i === error.data.length - 1) {
$log.debug(error.status + '=>' + msg);
callback(msg);
}
}, function (err) {
$log.error(err);
callback(msg);
});
}
return {
resolve: function (details, callback) {
if (details.error) {
var error = details.error;
// read by http code
$translate('HTTP_STATUS_CODE_' + error.status).then(function (translatedValue) {
var msg = translatedValue;
// handle violation errors
if (error.status === 400 && error.data && error.data.length) {
for (var i = 0; i < error.data.length; i++) {
blockUI.stop();
buildValidationMessages(error, msg, callback, i);
}
} else {
blockUI.stop();
$log.debug(error.status + '=>' + msg);
callback(msg);
}
});
}
}
};
});
This module instruments Angular's interceptors
to invoke a configurable set for the error handling.
FAQs
Enables general error handling and logging which allows to log errors, e.g for automatically sending back to the backend or for showing to the user
The npm package angular-invocation-handler receives a total of 0 weekly downloads. As such, angular-invocation-handler popularity was classified as not popular.
We found that angular-invocation-handler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.