how would you rewrite this vue app such that it returns proper error if anything goes wrong?
<main class="app-main">
<div class="request-form">
<div class="form-group">
<label for="apiUrl">API Endpoint</label>
<input
type="text"
id="apiUrl"
v-model="apiUrl"
placeholder="http://localhost:8080/descriptive"
class="form-input"
/>
</div>
<div class="form-group">
<label for="datasetPath">Dataset Path</label>
<input
type="text"
id="datasetPath"
v-model="datasetPath"
placeholder="G:\projects\uv_rup99\handyscripts\products-100.csv"
class="form-input"
/>
</div>
<div class="form-group">
<label for="column">Column</label>
<input
type="text"
id="column"
v-model="column"
placeholder="Price"
class="form-input"
/>
</div>
<button
@click="fetchData"
:disabled="isLoading"
class="submit-button"
>
<span v-if="!isLoading">Send Request</span>
<span v-else class="loading-indicator">
<span class="dot"></span>
<span class="dot"></span>
<span class="dot"></span>
</span>
</button>
</div>
<div class="results-container">
<div v-if="statusMessage" class="status-message" :class="statusType">
<div class="status-icon">
<svg v-if="statusType === 'success'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="currentColor" d="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M11,16.5L6.5,12L7.91,10.59L11,13.67L16.59,8.09L18,9.5L11,16.5Z" />
</svg>
<svg v-else-if="statusType === 'error'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="currentColor" d="M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 17.59,20 12,20M12,6C10.9,6 10,6.9 10,8C10,9.1 10.9,10 12,10C13.1,10 14,9.1 14,8C14,6.9 13.1,6 12,6M12,16C10.9,16 10,15.1 10,14C10,12.9 10.9,12 12,12C13.1,12 14,12.9 14,14C14,15.1 13.1,16 12,16Z" />
</svg>
<svg v-else xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
<path fill="currentColor" d="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9Z" />
</svg>
</div>
<div class="status-content">
<p>{{ statusMessage }}</p>
<div v-if="fullUrl" class="url-display">
<span class="url-label">Request URL:</span>
<code class="url-text">{{ fullUrl }}</code>
</div>
</div>
</div>
<div v-if="results" class="result-section">
<h3>Response Preview</h3>
<div class="json-container">
<highlightjs
language="json"
:code="formattedResults"
class="json-highlight"
/>
</div>
<button @click="copyToClipboard" class="copy-button">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16">
<path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H10A2,2 0 0,0 8,3V5H6A2,2 0 0,0 4,7V19A2,2 0 0,0 6,21H18A2,2 0 0,0 20,19V10H18V8A2,2 0 0,0 16,6V3A2,2 0 0,0 16,1Z" />
</svg>
Copy to Clipboard
</button>
</div>
<div v-if="errorDetails" class="error-section">
<h3>Error Details</h3>
<div class="error-content">
<highlightjs
language="json"
:code="formattedError"
class="json-highlight"
/>
</div>
</div>
</div>
</main>
<footer class="app-footer">
<p>API Client © {{ new Date().getFullYear() }}</p>
</footer>