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