From 35085839e17d353cb076ded07e129bbf66e1e8de Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 2 Dec 2017 22:56:57 -0500 Subject: [PATCH] remove redundant try-catch --- src/index.ts | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/index.ts b/src/index.ts index a6b1ccc32e..a2664c9293 100644 --- a/src/index.ts +++ b/src/index.ts @@ -69,28 +69,16 @@ async function _doPreprocess(source, type: 'script' | 'style', preprocessor: Pre export async function preprocess(source: string, options: PreprocessOptions) { const { markup, style, script } = options; if (!!markup) { - try { - const processed: { code: string, map?: SourceMap | string } = await markup({ content: source }); - source = processed.code; - } catch (error) { - defaultOnerror(error); - } + const processed: { code: string, map?: SourceMap | string } = await markup({ content: source }); + source = processed.code; } if (!!style) { - try { - source = await _doPreprocess(source, 'style', style); - } catch (error) { - defaultOnerror(error); - } + source = await _doPreprocess(source, 'style', style); } if (!!script) { - try { - source = await _doPreprocess(source, 'script', script); - } catch (error) { - defaultOnerror(error); - } + source = await _doPreprocess(source, 'script', script); } return {