loader_type_js: add ability to specify error handler #672

spyError.should.have.been.called;