web: fix error handling in forms for non-server errors
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
2e6a264f98
commit
926636c331
|
@ -59,8 +59,11 @@ export class Form<T> extends LitElement {
|
||||||
return ex.json();
|
return ex.json();
|
||||||
}
|
}
|
||||||
return ex;
|
return ex;
|
||||||
}).then((errorMessage: ErrorResponse) => {
|
}).then((errorMessage: ErrorResponse | Error) => {
|
||||||
if (!errorMessage) return errorMessage;
|
if (!errorMessage) return errorMessage;
|
||||||
|
if (errorMessage instanceof Error) {
|
||||||
|
throw errorMessage;
|
||||||
|
}
|
||||||
const elements: PaperInputElement[] = ironForm._getSubmittableElements();
|
const elements: PaperInputElement[] = ironForm._getSubmittableElements();
|
||||||
elements.forEach((element) => {
|
elements.forEach((element) => {
|
||||||
const elementName = element.name;
|
const elementName = element.name;
|
||||||
|
|
Reference in New Issue