Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: return structured error from deno_ast::ParsedSource::transpile #236

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

dsherret
Copy link
Member

Closes #118

@@ -150,11 +165,11 @@ impl ParsedSource {
&self,
transpile_options: &TranspileOptions,
emit_options: &EmitOptions,
) -> Result<EmittedSource> {
) -> Result<EmittedSource, TranspileError> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this work as part of another PR to make a transpile_owned(self) method, but then ended up deciding to return the failure of Arc::try_unwrap in the Ok result to force the caller to handle it.

ParseDiagnostics(#[from] ParseDiagnosticsError),
#[error(transparent)]
Swc(#[from] SwcFoldDiagnosticsError),
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should switch this to actually use the diagnostics in the future. This is a very rough/sloppy first pass.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@dsherret dsherret merged commit 0ee8654 into denoland:main Apr 12, 2024
2 checks passed
@dsherret dsherret deleted the refactor_add_more_error_types branch April 12, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return structured error from deno_ast::ParsedSource::transpile
2 participants