fix: improve error handling in proxy host form submission

This commit is contained in:
Wikid82
2025-11-22 22:02:48 -05:00
parent 3730ce3152
commit f258317190
+5 -2
View File
@@ -137,8 +137,11 @@ export default function ProxyHostForm({ host, onSubmit, onCancel }: ProxyHostFor
try {
await onSubmit(formData)
} catch (err) {
setError(err instanceof Error ? err.message : 'Failed to save proxy host')
} catch (err: any) {
console.error("Submit error:", err)
// Extract error message from axios response if available
const message = err.response?.data?.error || err.message || 'Failed to save proxy host'
setError(message)
} finally {
setLoading(false)
}