@ardimedia/angular-portal-azure 0.2.203 → 0.2.205

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 +2 -1
  2. package/apn.js +14 -26
  3. package/package.json +1 -1
package/apn.d.ts CHANGED
@@ -423,7 +423,8 @@ declare namespace angularportalazure {
423
423
  static getOneLineMessage(exception: angularportalazure.Exception): string;
424
424
  private static processDotNetException1(response);
425
425
  private static processDotNetException2(response);
426
- private static setExceptionType(response, exception);
426
+ private static setExceptionType1(response, exception);
427
+ private static setExceptionType2(response, exception);
427
428
  }
428
429
  }
429
430
  declare namespace angularportalazure {
package/apn.js CHANGED
@@ -1368,14 +1368,12 @@ var angularportalazure;
1368
1368
  //#region Static Methods
1369
1369
  // TODO:2017-01-09/hp: [any] will be [Response] in angular2
1370
1370
  Exception.prepareException = function (response) {
1371
- console.log('convertException: input [angular.IHttpPromiseCallbackArg<angularportalazure.Exception>]');
1372
- console.log(response);
1373
1371
  var exception = new angularportalazure.Exception();
1374
1372
  if (response.headers === undefined) {
1375
1373
  exception = Exception.processDotNetException1(response.data);
1376
1374
  exception.ExceptionMessage = response.data.ExceptionMessage;
1377
1375
  exception.StackTrace = response.data.StackTrace;
1378
- exception.ExceptionType = response.data.ExceptionType;
1376
+ Exception.setExceptionType1(response, exception);
1379
1377
  exception.Type = response.data.Type;
1380
1378
  exception.Message = response.data.Message;
1381
1379
  exception.MessageDetail = response.data.MessageDetail;
@@ -1388,7 +1386,7 @@ var angularportalazure;
1388
1386
  exception = Exception.processDotNetException2(response.data);
1389
1387
  exception.ExceptionMessage = response.json().ExceptionMessage;
1390
1388
  exception.StackTrace = response.json().StackTrace;
1391
- Exception.setExceptionType(response, exception);
1389
+ Exception.setExceptionType2(response, exception);
1392
1390
  exception.Type = response.json().Type;
1393
1391
  exception.Message = response.json().Message;
1394
1392
  exception.MessageDetail = response.json().MessageDetail;
@@ -1398,10 +1396,8 @@ var angularportalazure;
1398
1396
  exception.StatusText = response.statusText;
1399
1397
  }
1400
1398
  //// Find a better way to log information, maybe to the database or to Google Analytics.
1401
- //console.log('processException:');
1402
- //console.log(response);
1403
- //console.log(this);
1404
- console.log('convertException: output is converted [angularportalazure.Exception]');
1399
+ console.log('angularportalazure.Exception.prepareException - Logging Exception: Find more information in [Responsee] and [Exception] below. [Exception] does contain data from [Response.]');
1400
+ console.log(response);
1405
1401
  console.log(exception);
1406
1402
  return exception;
1407
1403
  };
@@ -1431,31 +1427,17 @@ var angularportalazure;
1431
1427
  i++;
1432
1428
  }
1433
1429
  //#endregion
1434
- //#region Process DbEntityValidationException
1435
- if (response.data.ExceptionType === 'System.Data.Entity.Validation.DbEntityValidationException') {
1436
- exception.ExceptionType = 'DbEntityValidationException';
1437
- }
1438
- //#endregion
1439
- //#region Process DbUpdateConcurrencyException
1440
- if (response.data.ExceptionType === 'System.Data.Entity.Infrastructure.DbUpdateConcurrencyException') {
1441
- exception.ExceptionType = 'DbUpdateConcurrencyException';
1442
- }
1443
- //#endregion
1444
- //#region Process ValidationsException
1445
- // ClassName should by ExceptionType
1446
- if (response.data.ClassName.indexOf('ValidationsException') > 0) {
1447
- exception.ExceptionType = 'ValidationsException';
1448
- }
1449
- //#endregion
1450
1430
  return exception;
1451
1431
  };
1452
1432
  // TODO:2017-01-09/hp: Implement this function for angular2
1453
1433
  Exception.processDotNetException2 = function (response) {
1454
1434
  var exception = new angularportalazure.Exception();
1455
- console.log('[angularportalazure.Exception.processDotNetException2] not yet implemented.');
1435
+ if (response.json().data !== undefined) {
1436
+ console.log('[angularportalazure.Exception.processDotNetException2] not yet implemented. Implement it to get proper exception data.');
1437
+ }
1456
1438
  return exception;
1457
1439
  };
1458
- Exception.setExceptionType = function (response, exception) {
1440
+ Exception.setExceptionType1 = function (response, exception) {
1459
1441
  if (response.data.ExceptionType === 'System.Data.Entity.Validation.DbEntityValidationException') {
1460
1442
  exception.ExceptionType = 'DbEntityValidationException';
1461
1443
  return;
@@ -1471,6 +1453,12 @@ var angularportalazure;
1471
1453
  }
1472
1454
  exception.ExceptionType = response.data.ExceptionType;
1473
1455
  };
1456
+ // TODO:2017-01-09/hp: Implement this function for angular2
1457
+ Exception.setExceptionType2 = function (response, exception) {
1458
+ if (response.json().ExceptionType !== undefined) {
1459
+ console.log('[angularportalazure.Exception.setExceptionType2] not yet implemented. Implement it to get proper exception data.');
1460
+ }
1461
+ };
1474
1462
  return Exception;
1475
1463
  }(angularportalazure.ValidationsExceptionDotNet));
1476
1464
  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.203",
5
+ "version": "0.2.205",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {