Debug.registerWarnHandler()

registerWarnHandler (handler) publicstatic

Defined in packages/ember-debug/lib/index.js:260
Available since 2.1.0

Allows for runtime registration of handler functions that override the default warning behavior. Warnings are invoked by calls made to Ember.warn. The following example demonstrates its usage by registering a handler that does nothing overriding Ember's default warning behavior.

// next is not called, so no warnings get the default behavior
Ember.Debug.registerWarnHandler(() => {});

The handler function takes the following arguments:

  • message - The message received from the warn call.
  • options - An object passed in with the warn call containing additional information including:
    • id - An id of the warning in the form of package-name.specific-warning.
  • next - A function that calls into the previously registered handler.

Parameters:

handler Function
A function to handle warnings.
doc_EmberJs
2016-11-30 16:49:13
Comments
Leave a Comment

Please login to continue.