fix(ci): e2e test error reporting

This commit is contained in:
Lucas Nogueira
2026-09-26 15:29:52 -03:00
parent 9b29b601f3
commit b6a38a5e32
+11 -1
View File
@@ -148,9 +148,19 @@ export async function tauri<R, A extends unknown[]>(
.then(
function (value) { return { ok: true, value: value === undefined ? null : value }; },
function (error) {
// Mobile plugins reject with a \`{ message, code?, data? }\` object
// rather than a string or an Error.
var message =
error instanceof Error
? error.message
: error && typeof error === 'object' && typeof error.message === 'string'
? error.message
: typeof error === 'object'
? JSON.stringify(error)
: String(error);
return {
ok: false,
error: error instanceof Error ? error.message : String(error),
error: message,
stack: error instanceof Error ? error.stack : undefined
};
}