Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add page name to crashes #65504

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions packages/next-swc/crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1250,24 +1250,25 @@ impl Endpoint for AppEndpoint {
#[turbo_tasks::function]
async fn write_to_disk(self: Vc<Self>) -> Result<Vc<WrittenEndpoint>> {
let this = self.await?;
let page_name = this.page.to_string();
let span = match this.ty {
AppEndpointType::Page {
ty: AppPageEndpointType::Html,
..
} => {
tracing::info_span!("app endpoint HTML", name = display(&this.page))
tracing::info_span!("app endpoint HTML", name = page_name)
}
AppEndpointType::Page {
ty: AppPageEndpointType::Rsc,
..
} => {
tracing::info_span!("app endpoint RSC", name = display(&this.page))
tracing::info_span!("app endpoint RSC", name = page_name)
}
AppEndpointType::Route { .. } => {
tracing::info_span!("app endpoint route", name = display(&this.page))
tracing::info_span!("app endpoint route", name = page_name)
}
AppEndpointType::Metadata { .. } => {
tracing::info_span!("app endpoint metadata", name = display(&this.page))
tracing::info_span!("app endpoint metadata", name = page_name)
}
};
async move {
Expand Down Expand Up @@ -1309,10 +1310,11 @@ impl Endpoint for AppEndpoint {
client_paths,
},
};
Ok(written_endpoint.cell())
anyhow::Ok(written_endpoint.cell())
}
.instrument(span)
.await
.with_context(|| format!("Failed to write app endpoint {}", page_name))
}

#[turbo_tasks::function]
Expand Down
5 changes: 3 additions & 2 deletions packages/next-swc/crates/next-api/src/pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,8 @@ impl Endpoint for PageEndpoint {
#[turbo_tasks::function]
async fn write_to_disk(self: Vc<Self>) -> Result<Vc<WrittenEndpoint>> {
let this = self.await?;
let original_name = this.original_name.await?;
let span = {
let original_name = this.original_name.await?;
match this.ty {
PageEndpointType::Html => {
tracing::info_span!("page endpoint HTML", name = *original_name)
Expand Down Expand Up @@ -1198,10 +1198,11 @@ impl Endpoint for PageEndpoint {
},
};

Ok(written_endpoint.cell())
anyhow::Ok(written_endpoint.cell())
}
.instrument(span)
.await
.with_context(|| format!("Failed to write page endpoint {}", *original_name))
}

#[turbo_tasks::function]
Expand Down
Loading