@@ -792,6 +792,8 @@ end
792792
793793--- Runs command with arguments, passing it some input, and returns the output.
794794-- @treturn string Output of command.
795+-- @raise A table containing the keys `command`, `error_code`, and `output` is
796+-- thrown if the command exits with a non-zero error code.
795797-- @usage
796798-- local ec, output = pandoc.pipe("sed", {"-e","s/a/b/"}, "abc")
797799function M.pipe (command, args, input)
@@ -806,9 +808,7 @@ function M.pipe (command, args, input)
806808 end
807809 }
808810 )
809− -- TODO: drop the wrapping call to `tostring` as soon as hslua supports
810− -- non-string error objects.
811− error(tostring(err))
811+ error(err)
812812 end
813813 return output
814814end