MCPcopy Create free account
hub / github.com/codecombat/codecombat / onError

Method onError

app/models/CocoModel.js:100–112  ·  view source on GitHub ↗
(level, jqxhr)

Source from the content-addressed store, hash-verified

98 }
99
100 onError (level, jqxhr) {
101 this.loading = false
102 this.jqxhr = null
103 if (jqxhr.status === 402) {
104 if (_.contains(jqxhr.responseText, 'must be enrolled')) {
105 return Backbone.Mediator.publish('level:license-required', {})
106 } else if (_.contains(jqxhr.responseText, 'be in a course')) {
107 return Backbone.Mediator.publish('level:course-membership-required', {})
108 } else {
109 return Backbone.Mediator.publish('level:subscription-required', {})
110 }
111 }
112 }
113
114 onLoaded () {
115 this.loaded = true

Callers

nothing calls this directly

Calls 1

publishMethod · 0.80

Tested by

no test coverage detected