# Fix failure to upload panics when multiple panics happen at the same time \(\#2616\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/8592208d3a967dea2aa77b2b2985d01b98b96e18)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 8592208d3a967dea2aa77b2b2985d01b98b96e18

Requested commit: 8592208d3a967dea2aa77b2b2985d01b98b96e18

Commit: 8592208d3a967dea2aa77b2b2985d01b98b96e18

Tree: 3b051d1fa1a67d36929f66a2303a94c99378a387

Author: Max Brunsfeld

Committer: GitHub

## Message

```
Fix failure to upload panics when multiple panics happen at the same time (#2616)

When multiple panics occur at the same time (usually because one thread
panics, and another thread joins it), multiple panic JSON objects can
get written to the same panic file. The resulting file won't be valid
JSON.

This PR addresses that problem via two changes:
* Format panic files as single-line JSON objects
* When a panic file  isn't valid JSON, try taking the first line

In the future, we could try combining all of the backtraces, but for
now, I just want to avoid a problem of not reporting a panic at all.

Release Notes:

- Fixed a problem with Zed's internal crash reporting.
```

## Parents

- [b9270925dd40b7458b96898529ab3055aaa3b8b7](https://git.cafe/gitcafe/zed/commit/b9270925dd40b7458b96898529ab3055aaa3b8b7?format=markdown)

- [e525706581f471efb222f47c2d8c2ae1e2d702b9](https://git.cafe/gitcafe/zed/commit/e525706581f471efb222f47c2d8c2ae1e2d702b9?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/8592208d3a967dea2aa77b2b2985d01b98b96e18?format=markdown)
