Skip to content

Attaching stdout, stderr to error objects #82

@deployable

Description

@deployable

The stdout and stderr that are returned from an exec error are lost during error handling. The error itself doesn't always include complete context of the problem.

It would be useful if they could be attached to the error object that is passed back to the callback.

attach_streams_to = ( obj, stdout, stderr )->
  obj.stdout = stdout
  obj.stderr = stderr
  obj

return attach_streams_to( err, stdout, stderr ) if err

I guess the next level is using spawn rather than exec and controlling streams and the error completely.

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