MCPcopy Create free account
hub / github.com/angular/dev-infra / onFinished

Function onFinished

github-actions/browserstack/set-browserstack-env.js:6791–6812  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

6789 if (finished) {
6790 return;
6791 }
6792 if (body.resume) {
6793 body.resume();
6794 }
6795 };
6796 const onClose = function() {
6797 queueMicrotask(() => {
6798 body.removeListener("error", onFinished);
6799 });
6800 if (!finished) {
6801 const err = new RequestAbortedError();
6802 queueMicrotask(() => onFinished(err));
6803 }
6804 };
6805 const onFinished = function(err) {
6806 if (finished) {
6807 return;
6808 }
6809 finished = true;
6810 assert(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
6811 socket.off("drain", onDrain).off("error", onFinished);
6812 body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
6813 if (!err) {
6814 try {
6815 writer.end();

Callers 2

onCloseFunction · 0.70
writeStreamFunction · 0.70

Calls 4

offMethod · 0.45
removeListenerMethod · 0.45
endMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected