It seems that at least some exceptions aren’t caught when thrown in a preprocessor. Using the js-yaml module I noticed that exceptions regarding syntax errors stopped short:
{ name: 'YAMLException',
reason: 'can not read a block mapping entry; a multiline key may not be an implicit key',
mark:
{ name: null,
buffer: '/:\n\n ...\n\u0000',
position: 390,
line: 14,
column: 12 },
message: 'JS-YAML: can not read a block mapping entry; a multiline key may not be an implicit key at line 15, column 13:\n /example:\n ^' }
Not sure what we can do about this beyond not using js-yaml in a worker process or somehow allowing worker-farm’s handling to be extended to support such cases.
It seems that at least some exceptions aren’t caught when thrown in a preprocessor. Using the js-yaml module I noticed that exceptions regarding syntax errors stopped short:
Catching the error on my own:
Running the same code in a process of my own rather than the preprocessor, the exception was thrown correctly. I suspect this has to do with worker-farm, see https://github.com/rvagg/node-worker-farm/issues/9. js-yaml throws it’s own
YAMLException
class but worker-farm only handles Errors.Not sure what we can do about this beyond not using js-yaml in a worker process or somehow allowing worker-farm’s handling to be extended to support such cases.