Skip to content

Making TypeProviders easier: FS3033 needs base exception message #17249

@Thorium

Description

@Thorium

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#.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions