c# - Serialize JavaScript Error to Web API 2 -
i want catch unhandled exceptions in angularjs app , send via api able log it.
is there object javascript error type serializes in .net?
$provide.decorator("$exceptionhandler", ['$delegate', '$injector', function ($delegate, $injector) { return function (exception, cause) { var $http = $injector.get("$http"); var log = { error: exception, message: cause } $http.post('api/log', log) .finally(function () { //send error page }); $delegate(exception, cause); }; }]);
Comments
Post a Comment