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

[Feature Request] More clear error message in case of problem with relative path #10266

Open
denisbredikhin opened this issue Oct 15, 2024 · 0 comments
Labels
static-site Produce static HTML output ready for publishing to hosts like GitHub pages

Comments

@denisbredikhin
Copy link

Hello,

in one of my md files I had the wrong path to another article (something like "~/docs/frameworks/api/components/httpclient.md").
When I was trying to build my documentation, I was getting exception:
System.NotSupportedException: Relative to path has too many '../'.
Which didn't tell anything about the file or path that has this problem.

I've built the local version of RelativePath class and changed the following line in the method MakeRelativeTo:
throw new NotSupportedException("Relative to path has too many '../'");

to

throw new NotSupportedException($"Relative to path ({relativeTo}) has more '../' than base path {this}.");

Now I can see which path has the problem.
Can you please include this small improvement to docfx?

@yufeih yufeih added the static-site Produce static HTML output ready for publishing to hosts like GitHub pages label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
static-site Produce static HTML output ready for publishing to hosts like GitHub pages
Projects
None yet
Development

No branches or pull requests

2 participants