mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Better frontend error messages
This commit is contained in:
parent
f9e35e6eaf
commit
6eeabf657e
1 changed files with 3 additions and 1 deletions
|
|
@ -180,9 +180,11 @@ export class SessionCreateForm extends LitElement {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const error = await response.json();
|
const error = await response.json();
|
||||||
|
// Use the detailed error message if available, otherwise fall back to the error field
|
||||||
|
const errorMessage = error.details || error.error || 'Unknown error';
|
||||||
this.dispatchEvent(
|
this.dispatchEvent(
|
||||||
new CustomEvent('error', {
|
new CustomEvent('error', {
|
||||||
detail: `Failed to create session: ${error.error}`,
|
detail: errorMessage,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue