Skip to content

Commit 325f313

Browse files
committed
Fixed angular stacking and not including browser info, bump version
1 parent d67ccad commit 325f313

17 files changed

+64
-116
lines changed

dist/exceptionless.d.ts

-2
Original file line numberDiff line numberDiff line change
@@ -531,5 +531,3 @@ export declare class BrowserStorageProvider implements IStorageProvider {
531531
export declare class DefaultSubmissionAdapter implements ISubmissionAdapter {
532532
sendRequest(request: SubmissionRequest, callback?: SubmissionCallback, isAppExiting?: boolean): void;
533533
}
534-
export declare function isBrowser(): boolean;
535-
export declare function browserInit(): void;

dist/exceptionless.js

+7-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.node.js

+5-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.node.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.universal.js

+12-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.universal.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.universal.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/exceptionless.universal.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/integrations/angular.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ angular.module('exceptionless', [])
22
.constant('$ExceptionlessClient', exceptionless.ExceptionlessClient.default)
33
.factory('exceptionlessHttpInterceptor', ['$q', '$ExceptionlessClient', function ($q, $ExceptionlessClient) {
44
return {
5-
responseError: function responseError(rejection) {
6-
if (rejection.status === 404) {
7-
$ExceptionlessClient.submitNotFound(rejection.config.url);
5+
responseError: function responseError(response) {
6+
if (response.status === 404) {
7+
$ExceptionlessClient.submitNotFound(response.config.url);
88
}
9-
else if (rejection.status !== 401) {
10-
var message = "[" + rejection.status + "] " + (rejection.data && rejection.data.Message ? rejection.data.Message : rejection.config.url);
9+
else if (response.status !== 401) {
10+
var message = "[" + response.status + "] " + (response.data && response.data.Message ? response.data.Message : response.config.url);
1111
$ExceptionlessClient.createUnhandledException(new Error(message), 'errorHttpInterceptor')
12-
.setManualStackingInfo({ Status: rejection.status, ExceptionType: 'Error', Path: rejection.config.method + ' ' + rejection.config.url })
13-
.setSource(rejection.config.url)
14-
.setProperty('request', rejection.config)
12+
.setSource(response.config.url)
13+
.setCode(response.status)
14+
.setProperty('response', response)
1515
.submit();
1616
}
17-
return $q.reject(rejection);
17+
return $q.reject(response);
1818
}
1919
};
2020
}])

src/exceptionless.node.ts

+5-9
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import { NodeRequestInfoCollector } from './services/NodeRequestInfoCollector';
88
import { NodeFileStorageProvider } from './storage/NodeFileStorageProvider';
99
import { NodeSubmissionAdapter } from './submission/NodeSubmissionAdapter';
1010

11-
export function isNode(): boolean {
12-
return typeof process !== 'undefined';
13-
}
11+
(function init() {
12+
if (typeof process === 'undefined') {
13+
return;
14+
}
1415

15-
export function nodeInit() {
1616
const defaults = Configuration.defaults;
1717
defaults.environmentInfoCollector = new NodeEnvironmentInfoCollector();
1818
defaults.errorParser = new NodeErrorParser();
@@ -92,8 +92,4 @@ export function nodeInit() {
9292
});
9393

9494
(Error as any).stackTraceLimit = Infinity;
95-
}
96-
97-
if (isNode()) {
98-
nodeInit();
99-
}
95+
})();

src/exceptionless.ts

+6-10
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ import { BrowserStorageProvider } from './storage/BrowserStorageProvider';
1111
import { DefaultSubmissionAdapter } from './submission/DefaultSubmissionAdapter';
1212
import { Utils } from './Utils';
1313

14-
export function isBrowser(): boolean {
15-
return typeof document !== 'undefined';
16-
}
17-
18-
export function browserInit() {
14+
(function init() {
1915
function getDefaultsSettingsFromScriptTag(): IConfigurationSettings {
2016
if (!document || !document.getElementsByTagName) {
2117
return null;
@@ -37,6 +33,10 @@ export function browserInit() {
3733
builder.submit();
3834
}
3935

36+
if (typeof document === 'undefined') {
37+
return;
38+
}
39+
4040
/*
4141
TODO: We currently are unable to parse string exceptions.
4242
function processJQueryAjaxError(event, xhr, settings, error:string): void {
@@ -86,11 +86,7 @@ export function browserInit() {
8686
// }
8787

8888
(Error as any).stackTraceLimit = Infinity;
89-
}
90-
91-
if (isBrowser()) {
92-
browserInit();
93-
}
89+
})();
9490

9591
// tslint:disable-next-line:prefer-const
9692
declare var $;

src/exceptionless.universal.ts

+2-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,2 @@
1-
import { browserInit, isBrowser } from './exceptionless';
2-
import { isNode, nodeInit } from './exceptionless.node';
3-
import { ExceptionlessClient } from './ExceptionlessClient';
4-
5-
if (isNode()) {
6-
nodeInit();
7-
ExceptionlessClient.default.config.log.trace('Using node Exceptionless implementation.');
8-
} else if (isBrowser()) {
9-
browserInit();
10-
ExceptionlessClient.default.config.log.trace('Using browser Exceptionless implementation.');
11-
} else {
12-
ExceptionlessClient.default.config.log.error('No Exceptionless implementation was found.');
13-
}
1+
import * as ExceptionlessBrowser from './exceptionless';
2+
import * as ExceptionlessNode from './exceptionless.node';

src/integrations/angular.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ angular.module('exceptionless', [])
66
.constant('$ExceptionlessClient', exceptionless.ExceptionlessClient.default)
77
.factory('exceptionlessHttpInterceptor', ['$q', '$ExceptionlessClient', ($q, $ExceptionlessClient) => {
88
return {
9-
responseError: function responseError(rejection) {
10-
if (rejection.status === 404) {
11-
$ExceptionlessClient.submitNotFound(rejection.config.url);
12-
} else if (rejection.status !== 401) {
13-
const message = `[${rejection.status}] ${(rejection.data && rejection.data.Message ? rejection.data.Message : rejection.config.url)}`;
9+
responseError: function responseError(response) {
10+
if (response.status === 404) {
11+
$ExceptionlessClient.submitNotFound(response.config.url);
12+
} else if (response.status !== 401) {
13+
const message = `[${response.status}] ${(response.data && response.data.Message ? response.data.Message : response.config.url)}`;
1414
$ExceptionlessClient.createUnhandledException(new Error(message), 'errorHttpInterceptor')
15-
.setManualStackingInfo({ Status: rejection.status, ExceptionType: 'Error', Path: rejection.config.method + ' ' + rejection.config.url })
16-
.setSource(rejection.config.url)
17-
.setProperty('request', rejection.config)
15+
.setSource(response.config.url)
16+
.setCode(response.status)
17+
.setProperty('response', response)
1818
.submit();
1919
}
20-
return $q.reject(rejection);
20+
return $q.reject(response);
2121
}
2222
};
2323
}])

src/services/DefaultModuleCollector.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { IModuleCollector } from './IModuleCollector';
55

66
export class DefaultModuleCollector implements IModuleCollector {
77
public getModules(context: EventPluginContext): IModule[] {
8-
if (document && document.getElementsByTagName) {
8+
if (!document || !document.getElementsByTagName) {
99
return null;
1010
}
1111

@@ -16,7 +16,7 @@ export class DefaultModuleCollector implements IModuleCollector {
1616
if (scripts[index].src) {
1717
modules.push({
1818
module_id: index,
19-
name: scripts[index].src,
19+
name: scripts[index].src.split('?')[0],
2020
version: Utils.parseVersion(scripts[index].src)
2121
});
2222
} else if (!!scripts[index].innerHTML) {

0 commit comments

Comments
 (0)