forked from mystiq/hydrogen-web
still finish item when not returning from sync callback
This commit is contained in:
parent
d01271fb15
commit
1942c31eff
1 changed files with 5 additions and 3 deletions
|
@ -69,6 +69,7 @@ export abstract class BaseLogger {
|
|||
}
|
||||
|
||||
_run<T>(item: ILogItem, callback: LogCallback<T>, logLevel: LogLevel, wantResult: true, filterCreator?: FilterCreator): T;
|
||||
// we don't return if we don't throw, as we don't have anything to return when an error is caught but swallowed for the fire-and-forget case.
|
||||
_run<T>(item: ILogItem, callback: LogCallback<T>, logLevel: LogLevel, wantResult: false, filterCreator?: FilterCreator): void;
|
||||
_run<T>(item: ILogItem, callback: LogCallback<T>, logLevel: LogLevel, wantResult: boolean, filterCreator?: FilterCreator): T | void {
|
||||
this._openItems.add(item);
|
||||
|
@ -108,11 +109,12 @@ export abstract class BaseLogger {
|
|||
if (wantResult) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
if(wantResult) {
|
||||
} else {
|
||||
finishItem();
|
||||
if(wantResult) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
finishItem();
|
||||
if (wantResult) {
|
||||
|
|
Loading…
Reference in a new issue