Skip to content

Commit c827112

Browse files
committed
compile-fun: move try catch to main
1 parent cc4c9b9 commit c827112

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/compile-fun.ls

+1-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ compile-fun = (opts, die) ->
8888
| otherwise => map fix-match, fns
8989

9090
debug (inspect piped-inline-functions), 'input code'
91-
try compile-and-eval piped-inline-functions, opts
92-
catch {message} then return die "Error: #{message}"
91+
compile-and-eval piped-inline-functions, opts
9392

9493
module.exports = compile-fun

src/main.ls

+2-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ main = (process-argv, stdin, stdout, stderr) ->
160160
if fun.opts then opts <<< argv.parse [,,] ++ words fun.opts
161161
else
162162
if is-empty opts._ then return die argv.help!
163-
fun = compile-fun opts, die
163+
try fun = compile-fun opts
164+
catch {message} then return die "Error: #{message}"
164165

165166
if opts.input-type in <[ csv tsv ]> then opts.slurp = true
166167
if opts.output-type in <[ csv tsv ]> then opts.unslurp = true

0 commit comments

Comments
 (0)