title: How do you throw Lua error up?
body: <p>Is it possible to throw a Lua error from a function to be handled by the script calling the function?</p>
  
  <p>For example the following will throw an error at indicated comment</p>
  
  <pre><code>local function aSimpleFunction(...)
      string.format(...) -- Error is indicated to be here
  end
  
  aSimpleFunction("An example function: %i",nil)
  </code></pre>
  
  <p>But what I would rather do is catch the error and throw out a custom error by the function caller</p>
  
  <pre><code>local function aSimpleFunction(...)
      if pcall(function(...)
          string.format(...)
      end) == false then
         -- I want to throw a custom error to whatever is making the call to this function
      end
  
  end
  
  aSimpleFunction("An example function: %i",nil) -- Want the error to start unwinding here 
  </code></pre>
  
  <p>The intention being that in my actual use cases my functions would be more complicated and I would like to provide more meaningful error messages</p>