Skip to content

Commit 22d1bd5

Browse files
authored
Merge pull request #8 from dannyhp1/develop
Added error handling for network connectivity issues.
2 parents 50771f9 + 88c8ec9 commit 22d1bd5

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/App/App.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ class App extends Component {
9797
}
9898

9999
this.addToLog(result)
100+
}).catch(error => {
101+
this.setFinishedStatus()
102+
103+
let currentResults = this.state.results
104+
currentResults.unshift('Code cannot be executed. Network connection to server cannot be established.\n')
105+
106+
this.setState({
107+
...this.state,
108+
results: currentResults
109+
})
100110
})
101111
}
102112

@@ -124,8 +134,7 @@ class App extends Component {
124134

125135
this.setState({
126136
...this.state,
127-
results: currentResults,
128-
disabled: false
137+
results: currentResults
129138
})
130139
}
131140

0 commit comments

Comments
 (0)