Open rjrudin opened 3 years ago
I forgot to include an example of a transform that throws an error - something this simple will do the trick:
function transform(content, context) {
console.log("this will throw an error", content.does.not.exist);
return content;
}
module.exports = {
transform
}
I wanted to notice, that apparently this bug happens only if transform module is in sjs. All errors are caught properly if module is in xquery, i.e.:
xquery version "1.0-ml";
module namespace mlcpFlow = "http://marklogic.com/data-hub/mlcp-flow-transform";
declare option xdmp:mapping "false";
declare function mlcpFlow:transform(
$content as map:map,
$context as map:map
) as map:map*
{
let $_ := fn:error(xs:QName("Error"), "Mock error")
return ()
};
To reproduce:
You'll get the following feedback from MLCP:
But no documents will be ingested. If you check the error log, you'll see these messages:
So those are good in that they indicate an error happened, but bad in that the URI isn't shown, so a user doesn't know where to check.
Expectation - the thread count shouldn't matter here; I should get the same feedback from MLCP as when the thread count is less than the number of documents being ingested - e.g.
Note that there might be other factors at play here - I don't know if the number of forests matters.