src/render.js
function(message) {

    // If an error already has been thrown, exit
    if (errorTarget) return message

    utils.doCallback('errorTriggered', message);
    utils.logError(message)

    // If no target DOM element exists, only do the logging
    if (!rootTarget) return message

    var messageProcessed = message
    var contextProcessed = null

    if (utils.isArray(message)) {
      messageProcessed = message[0]
      if (message[1].data) {
        contextProcessed = stringify(message[1].data.errors || message[1].data.error || message[1].data)
      } else {
        contextProcessed = stringify(message[1])
      }
    }

    var template = require('./templates/error.html');
    errorTarget = $(template.render({
      errorWarningIcon: require('!svg-inline!./assets/error-warning-icon.svg'),
      message: messageProcessed,
      context: contextProcessed
    }));

    rootTarget.append(errorTarget);

    return message

  }
function(message) {

    // If an error already has been thrown, exit
    if (errorTarget) return message

    utils.doCallback('errorTriggered', message);
    utils.logError(message)

    // If no target DOM element exists, only do the logging
    if (!rootTarget) return message

    var messageProcessed = message
    var contextProcessed = null

    if (utils.isArray(message)) {
      messageProcessed = message[0]
      if (message[1].data) {
        contextProcessed = stringify(message[1].data.errors || message[1].data.error || message[1].data)
      } else {
        contextProcessed = stringify(message[1])
      }
    }

    var template = require('./templates/error.html');
    errorTarget = $(template.render({
      errorWarningIcon: require('!svg-inline!./assets/error-warning-icon.svg'),
      message: messageProcessed,
      context: contextProcessed
    }));

    rootTarget.append(errorTarget);

    return message

  }
function ( message ) { // If an error already has been thrown, exit if ( errorTarget ) return message utils . doCallback ( 'errorTriggered' , message ) ; utils . logError ( message ) // If no target DOM element exists, only do the logging if ( ! rootTarget ) return message var messageProcessed = message var contextProcessed = null if ( utils . isArray ( message ) ) { messageProcessed = message [ 0 ] if ( message [ 1 ] . data ) { contextProcessed = stringify ( message [ 1 ] . data . errors || message [ 1 ] . data . error || message [ 1 ] . data ) } else { contextProcessed = stringify ( message [ 1 ] ) } } var template = require ( './templates/error.html' ) ; errorTarget = $ ( template . render ( { errorWarningIcon : require ( '!svg-inline!./assets/error-warning-icon.svg' ) , message : messageProcessed , context : contextProcessed } ) ) ; rootTarget . append ( errorTarget ) ; return message }
Show error and warning screen
Show error and warning screen