Skip to content

Send errors on PUT after stream is returned #115

Open
@bredar

Description

@bredar

We have to do some actions, after a file is uploaded. This actions can fail. How to send an error to WebDAV in this case?

protected _openWriteStream(
		path: WebDav.Path,
		ctx: WebDav.OpenWriteStreamInfo,
		callback: WebDav.ReturnCallback<Writable>
	): void {
      const  stream = createWriteStream('c:\upload', 'binary'); 
      stream.on('finish', async () => {
          // move file and stuff
          // -> how to raise an error so http 500 is sent?
     }
     callback(undefined, stream);
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions