diff --git a/REST/I2C_Function.py b/REST/I2C_Function.py index 249e600..5fc9d68 100644 --- a/REST/I2C_Function.py +++ b/REST/I2C_Function.py @@ -155,9 +155,6 @@ def analyze_data(num_numbers, bits_per_number, startup): return json.dumps(data) else: - os.unlink(filename) - os.unlink(binary_filename) - os.unlink(hex_filename) return 400 # Teste den Code diff --git a/REST/app.py b/REST/app.py index afbcbd9..ea47dc3 100644 --- a/REST/app.py +++ b/REST/app.py @@ -40,10 +40,10 @@ def get_random_numbers(): bits = request.args.get('numBits') if not quantity.isdigit() or not bits.isdigit(): - return create_response(400, 'Invalid input. Quantity and bits must be numeric.') + return create_response(400, 'Invalid input. Quantity and bits must be numeric') if int(quantity) <= 0 or int(bits) <= 0: - return create_response(400, 'Invalid input. Quantity and bits must be positive integers.') + return create_response(400, 'Invalid input. Quantity and bits must be positive integers') if not initialized: return create_response(432, 'System not ready; try init') diff --git a/REST/script.js b/REST/script.js index fe6993c..3665ea1 100644 --- a/REST/script.js +++ b/REST/script.js @@ -135,6 +135,9 @@ document.getElementById('generateButton').addEventListener('click', function(eve resultDiv.insertBefore(copyAllButton, table); // Füge den "Copy all" Button vor der Tabelle ein } else { + document.getElementById('status').innerText = 'Status: ' + data.status; + document.getElementById('description').innerText = data.description; + var errorParagraph = document.createElement('p'); errorParagraph.textContent = 'Error: ' + data.message; resultDiv.appendChild(errorParagraph);