@ardimedia/angular-portal-azure 0.2.197 → 0.2.199

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.
Files changed (3) hide show
  1. package/apn.d.ts +1 -0
  2. package/apn.js +24 -6
  3. package/package.json +1 -1
package/apn.d.ts CHANGED
@@ -422,6 +422,7 @@ declare namespace angularportalazure {
422
422
  static prepareException(response: angular.IHttpPromiseCallbackArg<angularportalazure.Exception> | any): angularportalazure.Exception;
423
423
  private static processDotNetException1(response);
424
424
  private static processDotNetException2(response);
425
+ private static setExceptionType(response, exception);
425
426
  }
426
427
  }
427
428
  declare namespace angularportalazure {
package/apn.js CHANGED
@@ -1369,6 +1369,7 @@ var angularportalazure;
1369
1369
  angularportalazure.ValidationsExceptionDotNet = ValidationsExceptionDotNet;
1370
1370
  })(angularportalazure || (angularportalazure = {}));
1371
1371
  "use strict";
1372
+ /// <reference path="exceptiondotnet.ts" />
1372
1373
  var angularportalazure;
1373
1374
  (function (angularportalazure) {
1374
1375
  var Exception = (function (_super) {
@@ -1378,7 +1379,7 @@ var angularportalazure;
1378
1379
  }
1379
1380
  //#endregion
1380
1381
  //#region Methods
1381
- // [any] will be [Response] in angular2
1382
+ // TODO:2017-01-09/hp: [any] will be [Response] in angular2
1382
1383
  Exception.prepareException = function (response) {
1383
1384
  console.log('convertException: input [angular.IHttpPromiseCallbackArg<angularportalazure.Exception>]');
1384
1385
  console.log(response);
@@ -1400,7 +1401,7 @@ var angularportalazure;
1400
1401
  exception = Exception.processDotNetException2(response.data);
1401
1402
  exception.ExceptionMessage = response.json().ExceptionMessage;
1402
1403
  exception.StackTrace = response.json().StackTrace;
1403
- exception.ExceptionType = response.json().ExceptionType;
1404
+ Exception.setExceptionType(response, exception);
1404
1405
  exception.Type = response.json().Type;
1405
1406
  exception.Message = response.json().Message;
1406
1407
  exception.MessageDetail = response.json().MessageDetail;
@@ -1419,7 +1420,7 @@ var angularportalazure;
1419
1420
  };
1420
1421
  Exception.processDotNetException1 = function (response) {
1421
1422
  var exception = new angularportalazure.Exception();
1422
- //#region Process data to Messages
1423
+ //#region Convert data to Messages
1423
1424
  exception.Messages = [];
1424
1425
  var i = 1;
1425
1426
  while (response.data[i + ''] !== undefined) {
@@ -1429,27 +1430,44 @@ var angularportalazure;
1429
1430
  //#endregion
1430
1431
  //#region Process DbEntityValidationException
1431
1432
  if (response.data.ExceptionType === 'System.Data.Entity.Validation.DbEntityValidationException') {
1432
- exception.Type = 'DbEntityValidationException';
1433
+ exception.ExceptionType = 'DbEntityValidationException';
1433
1434
  }
1434
1435
  //#endregion
1435
1436
  //#region Process DbUpdateConcurrencyException
1436
1437
  if (response.data.ExceptionType === 'System.Data.Entity.Infrastructure.DbUpdateConcurrencyException') {
1437
- exception.Type = 'DbUpdateConcurrencyException';
1438
+ exception.ExceptionType = 'DbUpdateConcurrencyException';
1438
1439
  }
1439
1440
  //#endregion
1440
1441
  //#region Process ValidationsException
1441
1442
  // ClassName should by ExceptionType
1442
1443
  if (response.data.ClassName.indexOf('ValidationsException') > 0) {
1443
- exception.Type = 'ValidationsException';
1444
+ exception.ExceptionType = 'ValidationsException';
1444
1445
  }
1445
1446
  //#endregion
1446
1447
  return exception;
1447
1448
  };
1449
+ // TODO:2017-01-09/hp: Implement this function for angular2
1448
1450
  Exception.processDotNetException2 = function (response) {
1449
1451
  var exception = new angularportalazure.Exception();
1450
1452
  console.log('[angularportalazure.Exception.processDotNetException2] not yet implemented.');
1451
1453
  return exception;
1452
1454
  };
1455
+ Exception.setExceptionType = function (response, exception) {
1456
+ if (response.data.ExceptionType === 'System.Data.Entity.Validation.DbEntityValidationException') {
1457
+ exception.ExceptionType = 'DbEntityValidationException';
1458
+ return;
1459
+ }
1460
+ else if (response.data.ExceptionType === 'System.Data.Entity.Infrastructure.DbUpdateConcurrencyException') {
1461
+ exception.ExceptionType = 'DbUpdateConcurrencyException';
1462
+ return;
1463
+ }
1464
+ else if (response.data.ClassName.indexOf('ValidationsException') > 0) {
1465
+ // ClassName should by ExceptionType
1466
+ exception.ExceptionType = 'ValidationsException';
1467
+ return;
1468
+ }
1469
+ exception.ExceptionType = response.data.ExceptionType;
1470
+ };
1453
1471
  return Exception;
1454
1472
  }(angularportalazure.ValidationsExceptionDotNet));
1455
1473
  angularportalazure.Exception = Exception;
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.197",
5
+ "version": "0.2.199",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {