Rename "crash" to "panic"

We are not really sending crash reports but Rust panics, so might
as well be clear about that.
This commit is contained in:
Antonio Scandurra 2022-05-02 17:36:56 +02:00
parent da3870ea31
commit 875cb13e6d
2 changed files with 16 additions and 20 deletions

View file

@ -26,7 +26,7 @@ pub fn routes(state: Arc<AppState>) -> Router<Body> {
put(update_user).delete(destroy_user).get(get_user),
)
.route("/users/:id/access_tokens", post(create_access_token))
.route("/crash", post(trace_crash))
.route("/panic", post(trace_panic))
.layer(
ServiceBuilder::new()
.layer(Extension(state))
@ -132,14 +132,14 @@ async fn get_user(
}
#[derive(Debug, Deserialize)]
struct Crash {
struct Panic {
version: String,
text: String,
}
#[instrument(skip(crash))]
async fn trace_crash(crash: Json<Crash>) -> Result<()> {
tracing::error!(version = %crash.version, text = %crash.text, "crash report");
#[instrument(skip(panic))]
async fn trace_panic(panic: Json<Panic>) -> Result<()> {
tracing::error!(version = %panic.version, text = %panic.text, "panic report");
Ok(())
}