Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
fix: async error handling during file loading
Browse files Browse the repository at this point in the history
  • Loading branch information
KnisterPeter committed Dec 14, 2016
1 parent 2adc18d commit 6b3636d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ export function rebundleFactory(state: State, paeckchenAst: ESTree.Program, cont
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(() => {
timer = setTimeout(async () => {
try {
context.logger.trace('bundle', `rebundle`);
bundleFunction(state, paeckchenAst, context, outputFunction);
await bundleFunction(state, paeckchenAst, context, outputFunction);
} catch (e) {
outputFunction(e, context);
}
Expand Down
2 changes: 1 addition & 1 deletion src/source-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { State } from './state';
async function readFiles(context: PaeckchenContext, files: string[], suffix: string): Promise<(string|undefined)[]> {
return await Promise.all(files.map(async path => {
try {
return context.host.readFile(`${path}${suffix}`);
return await context.host.readFile(`${path}${suffix}`);
} catch (e) {
return undefined;
}
Expand Down

0 comments on commit 6b3636d

Please sign in to comment.