Skip to content

Commit a6f539d

Browse files
Thoriumabelbraaksmavzarytovskiipsfinaki
authored
TypeProviders: Add inner base-exception description (#17251)
* TypeProviders: Add inner base-exception description * Release notes docs updated * Update src/Compiler/TypedTree/tainted.fs Thanks @abelbraaksma Co-authored-by: Abel Braaksma <[email protected]> * Update docs/release-notes/.FSharp.Compiler.Service/8.0.400.md Co-authored-by: Abel Braaksma <[email protected]> * Added @abelbraaksma's suggestion --------- Co-authored-by: Abel Braaksma <[email protected]> Co-authored-by: Vlad Zarytovskii <[email protected]> Co-authored-by: Petr <[email protected]>
1 parent f6e24e8 commit a6f539d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/release-notes/.FSharp.Compiler.Service/8.0.400.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* Allow #nowarn to support the FS prefix on error codes to disable warnings ([Issue #17206](https://github.com/dotnet/fsharp/issues/16447), [PR #17209](https://github.com/dotnet/fsharp/pull/17209))
2626
* Allow ParsedHashDirectives to have argument types other than strings ([Issue #17240](https://github.com/dotnet/fsharp/issues/16447), [PR #17209](https://github.com/dotnet/fsharp/pull/17209))
2727
* Parser: better recovery for unfinished patterns ([PR #17231](https://github.com/dotnet/fsharp/pull/17231))
28+
* Expose inner exception information of TypeProviders to help diagnostics in IDE ([PR #17251](https://github.com/dotnet/fsharp/pull/17251))
2829
* Parser: recover on empty match clause ([PR #17233](https://github.com/dotnet/fsharp/pull/17233))
2930

3031
### Changed

src/Compiler/TypedTree/tainted.fs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ type internal Tainted<'T> (context: TaintedContext, value: 'T) =
101101
| :? TypeProviderError -> reraise()
102102
| :? AggregateException as ae ->
103103
let errNum,_ = FSComp.SR.etProviderError("", "")
104-
let messages = [for e in ae.InnerExceptions -> e.Message]
104+
let messages = [for e in ae.InnerExceptions -> if isNull e.InnerException then e.Message else (e.Message + ": " + e.GetBaseException().Message)]
105105
raise <| TypeProviderError(errNum, this.TypeProviderDesignation, range, messages)
106106
| e ->
107107
let errNum,_ = FSComp.SR.etProviderError("", "")
108-
raise <| TypeProviderError((errNum, e.Message), this.TypeProviderDesignation, range)
108+
let error = if isNull e.InnerException then e.Message else (e.Message + ": " + e.GetBaseException().Message)
109+
raise <| TypeProviderError((errNum, error), this.TypeProviderDesignation, range)
109110

110111
member _.TypeProvider = Tainted<_>(context, context.TypeProvider)
111112

0 commit comments

Comments
 (0)