Skip to content

Commit

Permalink
Add proper error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
sukima committed Nov 8, 2015
1 parent 3a3e8ea commit 8a00164
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion _includes/developers_cards.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<div id="meetup-developers-error" class="alert alert-danger hidden">
<p>There was a problem fetching the developers list. Please reload the page to try again.</p>
<samp class="output"></samp>
</div>

<div id="developers">
<!-- Generating events below -->
</div>
Expand Down Expand Up @@ -109,7 +114,10 @@
$('#developers').append(paginator);
})
.fail(function(error) {
console.log(error);
$('#meetup-developers-error')
.removeClass('hidden')
.find('.output')
.text('' + error);
});

function createDevCard(dev) {
Expand Down
10 changes: 9 additions & 1 deletion _includes/meetup_cards.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<div id="meetup-events-error" class="alert alert-danger hidden">
<p>There was a problem fetching the Events. Please reload the page to try again.</p>
<samp class="output"></samp>
</div>

<div id="meetup-events">
<!-- Generating events below -->
</div>
Expand Down Expand Up @@ -40,7 +45,10 @@
})
})
.fail(function(error) {
console.log(error);
$('#meetup-events-error')
.removeClass('hidden')
.find('.output')
.text('' + error);
});

function createEventCard(event) {
Expand Down

0 comments on commit 8a00164

Please sign in to comment.