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

Making TypeProviders easier: FS3033 needs base exception message #17249

Closed
Thorium opened this issue May 25, 2024 · 3 comments
Closed

Making TypeProviders easier: FS3033 needs base exception message #17249

Thorium opened this issue May 25, 2024 · 3 comments
Labels
Area-TypeProviders Feature Improvement Theme-Simple-F# A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Milestone

Comments

@Thorium
Copy link
Contributor

Thorium commented May 25, 2024

When I'm using different type-providers (a lot) and they use external dependency dlls, which throw an error, the F# compiler throws generic FS3033: The type provider '%s' reported an error: %s

The error is typically:
"The type initializer for 'some.dll' threw an exception."

What I would like to get is, if the inner-exception is not null (usually not) then .GetBaseException().Message of that too, like:
FS3033: The type provider '%s' reported an error: %s ...with details: %s

The workaround most developers do:

  • Open issue to corresponding TypeProvider's repo
  • Curse both F# and TypeProviders
  • And wait the author to debug, meanwhile continue writing their C#.

The workaround I do:

  • Download the TypeProvider from the GitHub,
  • Compile it in debug-mode
  • Replace my NuGet cache dll files with built debug-versions
  • Then open the TP project and attach VS to my process throwing the error
  • ...and yes I do get the error, which is typically very simple to fix once you know it. Typically just another dll missing:

image

A simple fix would already had kept many devs in F#.

@abelbraaksma
Copy link
Contributor

I think this makes sense and is likely a simple change to do. I do use TPs and indeed, if they fail, it can be hard to diagnose.

@smoothdeveloper
Copy link
Contributor

related to #4978

@Thorium
Copy link
Contributor Author

Thorium commented Jun 27, 2024

I hope the merged commit will fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TypeProviders Feature Improvement Theme-Simple-F# A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Projects
Archived in project
Development

No branches or pull requests

4 participants