Skip to content

Commit 911bf1e

Browse files
committed
Check for the existence of the forc-doc binary before generating documentation and log a warning if it's missing.
1 parent 32025ea commit 911bf1e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/handlers/upload.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ async fn generate_and_upload_documentation(
9292
file_uploader: &FileUploader<'_, impl PinataClient, impl S3Client>,
9393
) -> Result<String, UploadError> {
9494
let forc_doc_bin_path = forc_path.join("bin/forc-doc");
95+
if !forc_doc_bin_path.exists() {
96+
tracing::warn!(
97+
"forc-doc binary not found at {}; skipping documentation generation",
98+
forc_doc_bin_path.display()
99+
);
100+
return Err(UploadError::FailedToGenerateDocumentation);
101+
}
95102

96103
// Generate documentation
97104
tracing::info!(

0 commit comments

Comments
 (0)