Skip to content

Error handling #38

@ggepenyan

Description

@ggepenyan

I want to handle errors with promises. I have promisified pipe method with bluebird, so my code looks like this

return writerPipe(
    mkdirp(csvPath).catch((error) => {
        return Promise.reject('error');
    })
  )
  .then(() => {.....

I'm not able to reject or resolve inside mkdrip(it's alternative for createWriteStream).
So actually I want to handle errors for this line and so on.
csvWriter.pipe(fs.createWriteStream(csvPath));
if I could call a callback like this csvWriter.pipe(fs.createWriteStream(csvPath), callback); It would be grat
What can I do? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions