Skip to content

Commit

Permalink
Added small error check for Socket.io server availability
Browse files Browse the repository at this point in the history
  • Loading branch information
Wildhoney committed Nov 7, 2013
1 parent aaeaa0a commit a4ae3d8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-sockets",
"version": "0.0.4",
"version": "0.1.0",
"homepage": "https://github.com/Wildhoney/EmberSockets",
"authors": [
"Adam Timberlake <[email protected]>"
Expand Down
4 changes: 2 additions & 2 deletions dist/ember-sockets.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-sockets",
"version": "0.0.4",
"version": "0.1.0",
"description": "Socket.io (WebSockets) integrated with Ember.js' observer pattern.",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions package/ember-sockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
var server = 'http://%@:%@'.fmt($ember.get(this, 'host'), $ember.get(this, 'port')),
socket = io.connect(server);

socket.on('error', function () {
// Throw an exception if an error occurs.
throw 'Unable to make a connection to the Socket.io server!';
});

// Store a reference to the socket.
this.set('socket', socket);

Expand Down

0 comments on commit a4ae3d8

Please sign in to comment.