luci-app-attendedsysupgrade: format error details
authorEric Fahlgren <redacted>
Sat, 21 Mar 2026 03:54:09 +0000 (20:54 -0700)
committerPaul Donald <redacted>
Mon, 23 Mar 2026 18:27:01 +0000 (19:27 +0100)
On certain rare errors, the ASU server returns a JSON formatted
block of details.  The app was just displaying this object directly,
resulting in displaying a useless 'Object [object]'.  If the error
details are not a string, then stringify it so we can make sense
of the error.

Signed-off-by: Eric Fahlgren <redacted>
applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js

index ca5f9954b4ecb4e6d17679671033ac44000ff803..19fc0d20c989771ae2cebb686fcbf0e869193df4 100644 (file)
@@ -283,6 +283,9 @@ return view.extend({
                        ...firmware
                };
                const request_str = JSON.stringify(request_data, null, 4);
+               if (typeof response.detail != "string") {
+                       response.detail = JSON.stringify(response.detail, null, 4);
+               }
                let body = [
                        E('p', {}, [
                                _('First, check'), ' ',
git clone https://git.99rst.org/PROJECT