       @compatible = @incompatibleModules.length is 0
     else
       @compatible = true
+
+  handleError: (message, error) ->
+    if error.filename and error.location and (error instanceof SyntaxError)
+      location = "#{error.filename}:#{error.location.first_line + 1}:#{error.location.first_column + 1}"
+      detail = "#{error.message} in #{location}"
+      stack = """
+        SyntaxError: #{error.message}
+          at #{location}
+      """
+    else
+      detail = error.message
+      stack = error.stack ? error
+
+    console.trace()
+    atom.notifications.addFatalError(message, {stack, detail, dismissable: true})

        @mainModule.activate?(atom.packages.getPackageState(@name) ? {})
        @mainActivated = true
        @activateServices()
    catch e
      console.warn "Failed to activate package named '#{@name}'", e.stack

    @activationDeferred?.resolve()


        @loadStylesheets()
        @settingsPromise = @loadSettings()
        @requireMainModule() unless @hasActivationCommands()
      catch error
        @handleError("Failed to load the #{@name} package", error)
    this

  reset: ->
