@ardimedia/angular-portal-azure 0.2.194 → 0.2.195
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/apn.d.ts +2 -2
- package/apn.js +32 -24
- package/package.json +1 -1
package/apn.d.ts
CHANGED
|
@@ -419,8 +419,8 @@ declare namespace angularportalazure {
|
|
|
419
419
|
Status: number | undefined;
|
|
420
420
|
StatusText: string | undefined;
|
|
421
421
|
Url: string;
|
|
422
|
-
|
|
423
|
-
|
|
422
|
+
static prepareException(response: angular.IHttpPromiseCallbackArg<angularportalazure.Exception>): angularportalazure.Exception;
|
|
423
|
+
private static processDotNetException(response);
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
426
|
declare namespace angularportalazure {
|
package/apn.js
CHANGED
|
@@ -1377,46 +1377,54 @@ var angularportalazure;
|
|
|
1377
1377
|
return _super.apply(this, arguments) || this;
|
|
1378
1378
|
}
|
|
1379
1379
|
//#endregion
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
this.Type = response.data.Type;
|
|
1384
|
-
this.Message = response.data.Message;
|
|
1385
|
-
this.MessageDetail = response.data.MessageDetail;
|
|
1386
|
-
this.Messages = response.data.Messages;
|
|
1387
|
-
this.Url = response.config.url;
|
|
1388
|
-
this.Status = response.status;
|
|
1389
|
-
this.StatusText = response.statusText;
|
|
1390
|
-
// Find a better way to log information, maybe to the database or to Google Analytics.
|
|
1391
|
-
console.log('processException:');
|
|
1380
|
+
//#region Methods
|
|
1381
|
+
Exception.prepareException = function (response) {
|
|
1382
|
+
console.log('convertException: input [angular.IHttpPromiseCallbackArg<angularportalazure.Exception>]');
|
|
1392
1383
|
console.log(response);
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1384
|
+
var exception = Exception.processDotNetException(response.data);
|
|
1385
|
+
exception.ExceptionType = response.data.ExceptionType;
|
|
1386
|
+
exception.Type = response.data.Type;
|
|
1387
|
+
exception.Message = response.data.Message;
|
|
1388
|
+
exception.MessageDetail = response.data.MessageDetail;
|
|
1389
|
+
exception.Messages = response.data.Messages;
|
|
1390
|
+
exception.Url = response.config.url;
|
|
1391
|
+
exception.Status = response.status;
|
|
1392
|
+
exception.StatusText = response.statusText;
|
|
1393
|
+
//// Find a better way to log information, maybe to the database or to Google Analytics.
|
|
1394
|
+
//console.log('processException:');
|
|
1395
|
+
//console.log(response);
|
|
1396
|
+
//console.log(this);
|
|
1397
|
+
console.log('convertException: output is converted [angularportalazure.Exception]');
|
|
1398
|
+
console.log(exception);
|
|
1399
|
+
return exception;
|
|
1400
|
+
};
|
|
1401
|
+
Exception.processDotNetException = function (response) {
|
|
1402
|
+
var exception = new angularportalazure.Exception();
|
|
1396
1403
|
//#region Process data to Messages
|
|
1397
|
-
|
|
1404
|
+
exception.Messages = [];
|
|
1398
1405
|
var i = 1;
|
|
1399
|
-
while (
|
|
1400
|
-
|
|
1406
|
+
while (response.data[i + ''] !== undefined) {
|
|
1407
|
+
exception.Messages.push(response.data[i + '']);
|
|
1401
1408
|
i++;
|
|
1402
1409
|
}
|
|
1403
1410
|
//#endregion
|
|
1404
1411
|
//#region Process DbEntityValidationException
|
|
1405
|
-
if (
|
|
1406
|
-
|
|
1412
|
+
if (response.data.ExceptionType === 'System.Data.Entity.Validation.DbEntityValidationException') {
|
|
1413
|
+
exception.Type = 'DbEntityValidationException';
|
|
1407
1414
|
}
|
|
1408
1415
|
//#endregion
|
|
1409
1416
|
//#region Process DbUpdateConcurrencyException
|
|
1410
|
-
if (
|
|
1411
|
-
|
|
1417
|
+
if (response.data.ExceptionType === 'System.Data.Entity.Infrastructure.DbUpdateConcurrencyException') {
|
|
1418
|
+
exception.Type = 'DbUpdateConcurrencyException';
|
|
1412
1419
|
}
|
|
1413
1420
|
//#endregion
|
|
1414
1421
|
//#region Process ValidationsException
|
|
1415
1422
|
// ClassName should by ExceptionType
|
|
1416
|
-
if (
|
|
1417
|
-
|
|
1423
|
+
if (response.data.ClassName.indexOf('ValidationsException') > 0) {
|
|
1424
|
+
exception.Type = 'ValidationsException';
|
|
1418
1425
|
}
|
|
1419
1426
|
//#endregion
|
|
1427
|
+
return exception;
|
|
1420
1428
|
};
|
|
1421
1429
|
return Exception;
|
|
1422
1430
|
}(angularportalazure.ValidationsExceptionDotNet));
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@ardimedia/angular-portal-azure",
|
|
3
3
|
"description": "Angular Portal Azure - GUI Framework.",
|
|
4
4
|
"author": "Ardimedia Anstalt <info@ardimedia.com> (http://www.ardimedia.com)",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.195",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"typings": "apn.d.ts",
|
|
8
8
|
"dependencies": {
|