bail early on errors

Returning errors can feel warm and fuzzy, but it does no good if the
caller doesn't actually check the return value.

Scenario:
  define a new function B
  call it when initializing global variable A
  everything works fine
  restart

Before this commit you get a weird error because we silently stopped
loading, and now lots of functions are missing.

After this commit you get a better error message.
This commit is contained in:
Kartik K. Agaram 2023-06-19 09:56:24 -07:00
parent 2f933e383d
commit d486f94a4b
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ function live.load_all()
assert(buf and buf ~= '')
local status, err = live.eval(buf)
if not status then
return err
error(err)
end
end
end