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

Improve message for broken markup. #370

Closed
3 tasks
matthid opened this issue Dec 22, 2015 · 2 comments
Closed
3 tasks

Improve message for broken markup. #370

matthid opened this issue Dec 22, 2015 · 2 comments

Comments

@matthid
Copy link
Member

matthid commented Dec 22, 2015

This will be a collection of error messages to improve:

  • Improve error message when Docs failed to build with an XML Parse error. #335

  • Improve exception handling in literate programming #360

  • Unresolved reference to log -> Print source (type/member) of the error. #366

  • [ ]

    ![Some alt text 'Stream'](Content/images/test.jpg test-screen")
    

    Notice the missing ", this currently crashes with a cryptic message:

    System.ArgumentOutOfRangeException: Length cannot be less than zero.
    Parameter name: length
    at System.String.Substring(Int32 startIndex, Int32 length)
    at FSharp.Markdown.Parser.getLinkAndTitle(String _arg1) in c:\Projects\FSharp.Formatting\src\FSharp.Markdown\MarkdownParser.fs:line 27
    at [email protected](Unit unitVar) in c:\Projects\FSharp.Formatting\src\FSharp.Markdown\MarkdownParser.fs:line 223
    at [email protected](Unit unitVar0)
    at [email protected](Unit unitVar0)
    at Microsoft.FSharp.Collections.Generator.Microsoft-FSharp-Collections-Generator-Generator-1-get_Apply@432.Invoke(Unit unitVar0)
    at Microsoft.FSharp.Collections.Generator.appG[a](Generator`1 g)
    at Microsoft.FSharp.Collections.Generator.EnumeratorWrappingLazyGenerator`1.System-Collections-IEnumerator-MoveNext()
    at <StartupCode$FSharp-Core>[email protected](IEnumerable`1& next)
    at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
    at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
    at [email protected](Unit unitVar) in c:\Projects\FSharp.Formatting\src\FSharp.Markdown\MarkdownParser.fs:line 635
    at [email protected](Unit unitVar0)
    at [email protected](IEnumerable`1& next) in c:\Projects\FSharp.Formatting\src\FSharp.Markdown\MarkdownParser.fs:line 616
    at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
    at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
    at [email protected](IEnumerable`1& next) in c:\Projects\FSharp.Formatting\src\FSharp.Markdown\MarkdownParser.fs:line 615
    at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
    at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
    at FSharp.Markdown.Parser.formatTree@612(ParsingContext ctx, FSharpList`1 nodes) in c:\Projects\FSharp.Formatting\src\FSharp.Markdown\MarkdownParser.fs:line 613
    at [email protected](Unit unitVar) in c:\Projects\FSharp.Formatting\src\FSharp.Markdown\MarkdownParser.fs:line 601
    at [email protected](Unit unitVar0)
    at [email protected](Unit unitVar0)
    at Microsoft.FSharp.Collections.Generator.Microsoft-FSharp-Collections-Generator-Generator-1-get_Apply@432.Invoke(Unit unitVar0)
    at Microsoft.FSharp.Collections.Generator.appG[a](Generator`1 g)
    at Microsoft.FSharp.Collections.Generator.EnumeratorWrappingLazyGenerator`1.System-Collections-IEnumerator-MoveNext()
    at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source)
    at FSharp.Markdown.Markdown.Parse(String text, String newline) in c:\Projects\FSharp.Formatting\src\FSharp.Markdown\Main.fs:line 56
    at FSharp.Literate.ParseMarkdown.parseMarkdown(String file, String text) in c:\Projects\FSharp.Formatting\src\FSharp.Literate\ParseMarkdown.fs:line 9
    at FSharp.Literate.Literate.ParseMarkdownFile[b](String path, FSharpOption`1 formatAgent, FSharpOption`1 compilerOptions, FSharpOption`1 definedSymbols, FSharpOption`1 references, FSharpOption`1 fsiEvaluator) in c:\Projects\FSharp.Formatting\src\FSharp.Literate\Main.fs:line 85
    
@neoeinstein
Copy link

It has been a little while since I was tinkering with this, but regarding #360 and the silent discard of exceptions during evaluation, I think that it is currently explicit here:
https://github.com/tpetricek/FSharp.Formatting/blob/master/src/FSharp.Literate/Evaluator.fs#L170

I would like it if this were changed so that the evaluation would return the error message as output and bind it/result (depending on how the block was defined) to the exception. I could take a swing at, but won't get to it until the weekend at the least.

@dsyme
Copy link
Contributor

dsyme commented Nov 10, 2021

Closing this very old issue

@dsyme dsyme closed this as completed Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants