A timeline is not a call stack.
Browser stream capture puts console output, network requests and uncaught exceptions on one timeline. The order is evidence. The cause is not in it.
Streams have no function to watch
Most lensd capture is placed: a lens at a function records what went in and what came out. A browser page also produces things that don’t belong to any one function, such as console output, network requests and uncaught exceptions. Stream capture records those three.
Every record carries a timestamp and a sequence number, so the three streams can be read as one ordered list. That list is the figure below.
What the order gives you
Read left to right, the trace looks like a story: the click sent a request, the request failed, and the failure threw. The trace supports only part of that. It shows that each event came before the next. It doesn’t show that any of them produced the next.
The exception record says where the error was thrown. It doesn’t say which earlier event put the bad value there. At least two other stories fit the same three records:
- The handler throws on this input whatever the server answers, and the 503 is a coincidence.
- Something unrelated to the click, a timer or another listener, threw at about the same time.
What would separate them
In a test fixture, keep the click and the input the same and change only the response. If the exception appears with both responses, the failed request doesn’t explain it. If it follows only the 503, the next thing to inspect is how the handler reads an error response.
That is one controlled change, and it does what a longer trace can’t. More events on the timeline add more order, and order was never the missing part.
From reading to acting
Changing only the response is an unhappy-path stub: for this flow, the request to /orders returns 200 in one run and 503 in the other, and the handler under test stays real. Stream capture supplies the question. A write action answers it.