@ardimedia/angular-portal-azure 0.2.193 → 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.
Files changed (3) hide show
  1. package/apn.d.ts +10 -14
  2. package/apn.js +33 -25
  3. package/package.json +1 -1
package/apn.d.ts CHANGED
@@ -389,30 +389,26 @@ declare namespace angularportalazure {
389
389
  }
390
390
  declare namespace angularportalazure {
391
391
  class ExceptionDotNet {
392
- Data: {
393
- key: number;
394
- value: string;
395
- }[];
396
- HelpLink: string;
397
- HResult: number;
398
- InnerException: Exception;
399
- Message: string;
400
- Source: string;
401
- StackTrace: string;
402
392
  ExceptionMessage: string;
403
393
  ExceptionType: string;
404
- ClassName: string;
394
+ Message: string;
395
+ StackTrace: string;
405
396
  }
406
397
  class ValidationResultDotNet {
407
398
  ErrorMessage: string;
408
399
  MemberNames: string[];
409
400
  }
410
401
  class ValidationsExceptionDotNet extends ExceptionDotNet {
402
+ ClassName: string;
403
+ Data: {
404
+ key: number;
405
+ value: string;
406
+ }[];
411
407
  ValidationResults: ValidationResultDotNet[];
412
408
  }
413
409
  }
414
410
  declare namespace angularportalazure {
415
- class Exception extends angularportalazure.ExceptionDotNet {
411
+ class Exception extends angularportalazure.ValidationsExceptionDotNet {
416
412
  ExceptionMessage: string;
417
413
  ExceptionType: string;
418
414
  Message: string;
@@ -423,8 +419,8 @@ declare namespace angularportalazure {
423
419
  Status: number | undefined;
424
420
  StatusText: string | undefined;
425
421
  Url: string;
426
- processException(response: angular.IHttpPromiseCallbackArg<any>): void;
427
- convertFromWebApiException(ex: angularportalazure.Exception): void;
422
+ static prepareException(response: angular.IHttpPromiseCallbackArg<angularportalazure.Exception>): angularportalazure.Exception;
423
+ private static processDotNetException(response);
428
424
  }
429
425
  }
430
426
  declare namespace angularportalazure {
package/apn.js CHANGED
@@ -1377,49 +1377,57 @@ var angularportalazure;
1377
1377
  return _super.apply(this, arguments) || this;
1378
1378
  }
1379
1379
  //#endregion
1380
- Exception.prototype.processException = function (response) {
1381
- this.convertFromWebApiException(response.data);
1382
- this.ExceptionType = response.data.ExceptionType;
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
- console.log(this);
1394
- };
1395
- Exception.prototype.convertFromWebApiException = function (ex) {
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
- ex.Messages = [];
1404
+ exception.Messages = [];
1398
1405
  var i = 1;
1399
- while (ex.Data[i + ''] !== undefined) {
1400
- ex.Messages.push(ex.Data[i + '']);
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 (ex.ExceptionType === 'System.Data.Entity.Validation.DbEntityValidationException') {
1406
- ex.Type = 'DbEntityValidationException';
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 (ex.ExceptionType === 'System.Data.Entity.Infrastructure.DbUpdateConcurrencyException') {
1411
- ex.Type = 'DbUpdateConcurrencyException';
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 (ex.ClassName.indexOf('ValidationsException') > 0) {
1417
- ex.Type = 'ValidationsException';
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
- }(angularportalazure.ExceptionDotNet));
1430
+ }(angularportalazure.ValidationsExceptionDotNet));
1423
1431
  angularportalazure.Exception = Exception;
1424
1432
  })(angularportalazure || (angularportalazure = {}));
1425
1433
  /// <reference types="angular" />
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.193",
5
+ "version": "0.2.195",
6
6
  "main": "index.js",
7
7
  "typings": "apn.d.ts",
8
8
  "dependencies": {