Skip to content

Commit 0c4cd52

Browse files
committed
Exit process regardless of api request result
1 parent becfaaa commit 0c4cd52

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "algorithm-visualizer",
3-
"version": "2.1.5",
3+
"version": "2.1.6",
44
"description": "JavaScript Tracers for Algorithm Visualizer",
55
"main": "dist/tracers.js",
66
"scripts": {

src/Tracer.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,9 @@ if (ALGORITHM_VISUALIZER) {
5050
const opn = require('opn');
5151
process.on('beforeExit', () => {
5252
axios.post('https://algorithm-visualizer.org/api/visualizations', { content: JSON.stringify(Tracer.traces) })
53-
.then(response => {
54-
opn(response.data, { wait: false });
55-
process.exit();
56-
});
53+
.then(response => opn(response.data, { wait: false }))
54+
.catch(console.error)
55+
.finally(() => process.exit());
5756
});
5857
}
5958

0 commit comments

Comments
 (0)