Skip to content
This repository was archived by the owner on Jun 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #203 from stephen/graceful-error
Browse files Browse the repository at this point in the history
Gracefully handle errors emitted by tunnel
  • Loading branch information
stephen committed Sep 20, 2015
2 parents a9404f4 + 8a4b4a4 commit ef1ea96
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/airsonos.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ class AirSonos {

let promises = devices.map((device) => {
return DeviceTunnel.createFor(device, this.options).then((tunnel) => {

tunnel.on('error', function(err) {
if (err.code === 415) {
console.error('Warning!', err.message);
console.error('AirSonos currently does not support codecs used by applications such as iTunes or AirFoil.');
console.error('Progress on this issue: https://github.com/stephen/nodetunes/issues/1');
} else {
console.error('Unknown error:');
console.error(err);
}
});

tunnel.start();
this.tunnels[tunnel.device.groupId] = tunnel;

Expand Down

0 comments on commit ef1ea96

Please sign in to comment.