     unless failedWeeksArray.length > 0
       navbarCollapsedState('add')
   .catch (err) ->
-    # Failed to get user info or there were server-side errors while getting
-    # weekly charts.
-    message = err.responseJSON?.error ? ''
-    if message.indexOf('error code 6') > -1
+    console.error(err)
+    if err.message.indexOf('error code 6') > -1
       # No user with that name was found.
       $username = $('#username')
       $username.parent().addClass('has-error').addClass('has-feedback')

  new Promise (resolve, reject) ->
    $.getJSON(url, params)
    .done (result) -> resolve(result)
    .fail (jqxhr, textStatus, error) -> reject(jqxhr)


setDefaults = (params) ->


hideAlert = ->
  $('#alert').addClass('hidden')
  $('#alert')
    .removeClass('alert-success')
    .removeClass('alert-info')
    .removeClass('alert-warning')
    .removeClass('alert-danger')


showAlert = (type, reason, message) ->
