From 041c5dd24576898a59331e7bebb458b3b5bcc4dd Mon Sep 17 00:00:00 2001
From: Eric Rosenbaum <eric.rosenbaum@gmail.com>
Date: Tue, 26 Jun 2018 22:04:02 -0400
Subject: [PATCH] Add back in error reporting

that I accidentally removed
---
 src/containers/connection-modal.jsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/containers/connection-modal.jsx b/src/containers/connection-modal.jsx
index 15653c7c6..857ffd191 100644
--- a/src/containers/connection-modal.jsx
+++ b/src/containers/connection-modal.jsx
@@ -10,7 +10,8 @@ class ConnectionModal extends React.Component {
         bindAll(this, [
             'handleAbortConnecting',
             'handleConnected',
-            'handleConnecting'
+            'handleConnecting',
+            'handleError'
         ]);
         this.state = {
             phase: 'scanning'
@@ -18,9 +19,11 @@ class ConnectionModal extends React.Component {
     }
     componentDidMount () {
         this.props.vm.on('PERIPHERAL_CONNECTED', this.handleConnected);
+        this.props.vm.on('PERIPHERAL_ERROR', this.handleError);
     }
     componentWillUnmount () {
         this.props.vm.removeListener('PERIPHERAL_CONNECTED', this.handleConnected);
+        this.props.vm.removeListener('PERIPHERAL_ERROR', this.handleError);
     }
     handleConnecting (peripheralId) {
         this.props.vm.connectToPeripheral(this.props.extensionId, peripheralId);
@@ -28,6 +31,11 @@ class ConnectionModal extends React.Component {
             phase: 'connecting'
         });
     }
+    handleError () {
+        this.setState({
+            phase: 'error'
+        });
+    }
     handleAbortConnecting () {
         // @todo: abort the current device connection process in the VM
         this.setState({
-- 
GitLab