marionettejs / backbone.wreqr

Messaging patterns for Backbone applications.
Other
346 stars 53 forks source link

Request or Command not found fails silently #61

Closed maxlath closed 9 years ago

maxlath commented 9 years ago

Hi! There might be a very good reason for that but why does neither Request or Command warn when it doesn't find the handler? Something like:

if (this.hasHandler(name)) {
  return this.getHandler(name).apply(this, args);
} else {
  console.warn('Request handler not found: ' + name)
}

it would have saved me hours of silly debugging, like times I inadvertently request a command or vice versa.

jamesplease commented 9 years ago

This used to throw an Error, but it doesn't anymore because of https://github.com/marionettejs/backbone.wreqr/pull/27

I completely feel the pain you're having with trying to develop with the silent Wreqr API. Unfortunately, Wreqr is deprecated and won't be receiving any more feature updates, like a DEBUG mode. But not all hope is lost! Although Wreqr doesn't support an idea of a DEBUG mode, Radio, its successor, does.

I encourage you to move over to Radio to reap the benefits of the better API and better features!

Let me know if you have any more Q's @maxlath.

maxlath commented 9 years ago

thanks @jmeas for your answer! Indeed, I know I should move to Radio eventually, but I was thinking to just wait for Marionette v3 to push it as a dependency :)