Derives the inspectable payload from a toast's message line. The api
client throws "<status>: <body>", which toasts show verbatim; here the
body is pretty-printed when it is JSON so the panel shows the server's
error structure legibly. Messages without a status prefix carry nothing
beyond themselves, so they yield undefined (the panel falls back to the
message).
Derives the inspectable payload from a toast's message line. The api client throws
"<status>: <body>", which toasts show verbatim; here the body is pretty-printed when it is JSON so the panel shows the server's error structure legibly. Messages without a status prefix carry nothing beyond themselves, so they yieldundefined(the panel falls back to the message).