I'm not quite sure (and I didn't find any information) but I think that error should be able to receive any data type as first argument. This works in the official Lua interpreter but not in Lightroom. Lightroom simply converts tables to strings (as if a tostring()function was called).
Most of the Lightoom API functions return a true/false and a description on fail. On one hand it's good - you see a description of the problem; on the other hand it's not that good because distinguishing different problems by a program is hard (usually string traversal operations are involved; what happens if the string is changed?). Maybe it's a good idea the returned values to be an exit code (e.g. zero for success and anything else for error) and the very same description.