diff --git a/ui/mock-server.js b/ui/mock-server.js index a82cbb4..3b8e19b 100644 --- a/ui/mock-server.js +++ b/ui/mock-server.js @@ -4,7 +4,15 @@ const express = require('express') const app = express() const port = 3000 +let showError = false + function progressSimulation (res) { + if (showError) { + var resp = JSON.stringify({ Error: 'Simulated error.' }) + '\n' + res.write(resp) + res.status(200).end() + return + } var progress = 0.0 var timer = setInterval(() => { var resp = JSON.stringify({ Status: ['Processing...', progress] }) + '\n' @@ -18,6 +26,10 @@ function progressSimulation (res) { } function returnConfig (res) { + if (showError) { + res.status(500).json({}) + return + } res.json({ installing_message: 'Test Banner Bold
Code blockItalic