Skip to content

Commit 363004f

Browse files
committed
Merge pull request #30 from frankebersoll/master
Fix: Log unhandled exceptions in Node.js
2 parents 336ee20 + 8b84e45 commit 363004f

40 files changed

+840
-539
lines changed

dist/exceptionless.d.ts

+29-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface ILog {
2222
}
2323
export interface IEventQueue {
2424
enqueue(event: IEvent): void;
25-
process(): void;
25+
process(isAppExiting?: boolean): void;
2626
suspendProcessing(durationInMinutes?: number, discardFutureQueuedItems?: boolean, clearQueue?: boolean): void;
2727
}
2828
export interface IEnvironmentInfoCollector {
@@ -43,8 +43,11 @@ export interface IStorage<T> {
4343
getList(searchPattern?: string, limit?: number): IStorageItem<T>[];
4444
remove(path: string): void;
4545
}
46+
export interface ISubmissionAdapter {
47+
sendRequest(request: SubmissionRequest, callback: SubmissionCallback, isAppExiting?: boolean): void;
48+
}
4649
export interface ISubmissionClient {
47-
postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void): void;
50+
postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void;
4851
postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void;
4952
getSettings(config: Configuration, callback: (response: SettingsResponse) => void): void;
5053
}
@@ -59,6 +62,7 @@ export interface IConfigurationSettings {
5962
requestInfoCollector?: IRequestInfoCollector;
6063
submissionBatchSize?: number;
6164
submissionClient?: ISubmissionClient;
65+
submissionAdapter?: ISubmissionAdapter;
6266
storage?: IStorage<any>;
6367
queue?: IEventQueue;
6468
}
@@ -124,7 +128,7 @@ export declare class DefaultEventQueue implements IEventQueue {
124128
private _queueTimer;
125129
constructor(config: Configuration);
126130
enqueue(event: IEvent): void;
127-
process(): void;
131+
process(isAppExiting?: boolean): void;
128132
private processSubmissionResponse(response, events);
129133
private ensureQueueTimer();
130134
private onProcessQueue();
@@ -142,6 +146,14 @@ export declare class InMemoryStorage<T> implements IStorage<T> {
142146
getList(searchPattern?: string, limit?: number): IStorageItem<T>[];
143147
remove(path: string): void;
144148
}
149+
export declare class DefaultSubmissionClient implements ISubmissionClient {
150+
configurationVersionHeader: string;
151+
postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void, isAppExiting?: boolean): void;
152+
postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void;
153+
getSettings(config: Configuration, callback: (response: SettingsResponse) => void): void;
154+
private createRequest(config, method, path, data?);
155+
private createSubmissionCallback(config, callback);
156+
}
145157
export declare class Utils {
146158
static addRange<T>(target: T[], ...values: T[]): T[];
147159
static getHashCode(source: string): string;
@@ -164,6 +176,7 @@ export declare class Configuration implements IConfigurationSettings {
164176
moduleCollector: IModuleCollector;
165177
requestInfoCollector: IRequestInfoCollector;
166178
submissionBatchSize: number;
179+
submissionAdapter: ISubmissionAdapter;
167180
submissionClient: ISubmissionClient;
168181
settings: Object;
169182
storage: IStorage<Object>;
@@ -382,6 +395,17 @@ export interface IStorageItem<T> {
382395
path: string;
383396
value: T;
384397
}
398+
export interface SubmissionCallback {
399+
(status: number, message: string, data?: string, headers?: Object): void;
400+
}
401+
export interface SubmissionRequest {
402+
serverUrl: string;
403+
apiKey: string;
404+
userAgent: string;
405+
method: string;
406+
path: string;
407+
data: string;
408+
}
385409
export declare class SettingsResponse {
386410
success: boolean;
387411
settings: any;
@@ -403,10 +427,6 @@ export declare class DefaultModuleCollector implements IModuleCollector {
403427
export declare class DefaultRequestInfoCollector implements IRequestInfoCollector {
404428
getRequestInfo(context: EventPluginContext): IRequestInfo;
405429
}
406-
export declare class DefaultSubmissionClient implements ISubmissionClient {
407-
configurationVersionHeader: string;
408-
postEvents(events: IEvent[], config: Configuration, callback: (response: SubmissionResponse) => void): void;
409-
postUserDescription(referenceId: string, description: IUserDescription, config: Configuration, callback: (response: SubmissionResponse) => void): void;
410-
getSettings(config: Configuration, callback: (response: SettingsResponse) => void): void;
411-
sendRequest(config: Configuration, method: string, path: string, data: string, callback: (status: number, message: string, data?: string, headers?: Object) => void): void;
430+
export declare class DefaultSubmissionAdapter implements ISubmissionAdapter {
431+
sendRequest(request: SubmissionRequest, callback: SubmissionCallback, isAppExiting?: boolean): void;
412432
}

dist/exceptionless.js

+79-55
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

+2-3
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.

0 commit comments

Comments
 (0)