dotnet / fsharp

The F# compiler, F# core library, F# language service, and F# tooling integration for Visual Studio
https://dotnet.microsoft.com/languages/fsharp
MIT License
3.82k stars 773 forks source link

Making TypeProviders easier: FS3033 needs base exception message #17249

Closed Thorium closed 1 week ago

Thorium commented 1 month ago

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:

The workaround I do:

image

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

abelbraaksma commented 1 month ago

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 commented 1 month ago

related to #4978

Thorium commented 1 week ago

I hope the merged commit will fix this.