Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Emit error instead of throwing #8

Merged
merged 1 commit into from over 1 year ago

2 participants

Raynos (Jake Verbaten) Dominic Tarr
Raynos (Jake Verbaten)

This allows me to catch the error more gracefully and close that server <-> client connection.

This will force to browser to open a fresh connection which doesn't have streams in corrupted state.

Raynos (Jake Verbaten) Emit error instead of throwing
This allows me to catch the error more gracefully and close that server <-> client connection.

This will force to browser to open a fresh connection which doesn't have streams in corrupted state.
739c63e
Dominic Tarr dominictarr merged commit 739c63e into from August 09, 2012
Dominic Tarr dominictarr closed this August 09, 2012
Dominic Tarr
Owner

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 09, 2012
Raynos (Jake Verbaten) Emit error instead of throwing
This allows me to catch the error more gracefully and close that server <-> client connection.

This will force to browser to open a fresh connection which doesn't have streams in corrupted state.
739c63e
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  index.js
2  index.js
@@ -60,7 +60,7 @@ function MuxDemux (opts) {
60 60
   function createStream(id, meta, opts) {
61 61
     var s = es.through(function (data) {
62 62
       if(!this.writable)
63  
-        throw new Error('stream is not writable')
  63
+        return outer.emit("error", Error('stream is not writable: ' + id))
64 64
       md.emit('data', [s.id, 'data', data])
65 65
     }, function () {
66 66
       md.emit('data', [s.id, 'end'])
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.