JosefNemec/Playnite · error · Exception
Unsupported URL format.
Error message
Unsupported URL format.
What it means
Thrown by the URL command dispatcher when the `url` argument is not one of the supported types (string, Link, or Uri). The method switches on the runtime type of an object parameter; anything else falls through to the throw, signaling an unsupported input shape rather than a bad value.
Source
Thrown at source/Playnite/Commands/GlobalCommands.cs:76
});
public static void NavigateUrl(object url)
{
if (url is string stringUrl)
{
NavigateUrl(stringUrl);
}
else if (url is Link linkUrl)
{
NavigateUrl(linkUrl.Url);
}
else if (url is Uri uriUrl)
{
NavigateUrl(uriUrl.OriginalString);
}
else
{
throw new Exception("Unsupported URL format.");
}
}
public static void NavigateUrl(string url)
{
if (url.IsNullOrEmpty())
{
throw new Exception("No URL was given.");
}
if (url.StartsWith("{DocsRootUrl}", StringComparison.OrdinalIgnoreCase))
{
url = Url.Combine(PlayniteEnvironment.DocsRootUrl, url.Replace("{DocsRootUrl}", ""));
}
url = url.Replace("{AppBranch}", PlayniteEnvironment.AppBranch);
if (!Regex.IsMatch(url, @"^.*:\/\/"))
{
View on GitHub (pinned to 5911f4e964)
Solutions
- Pass the correct type: extract .Url from a Link, call .ToString()/.OriginalString on a Uri, or a plain string.
- Type-check the argument before dispatch and convert it to string/Link/Uri.
- Narrow the command parameter type at the binding source so unsupported types never reach the dispatcher.
Example fix
// before Commands.NavigateUrl(someModel); // after Commands.NavigateUrl(someModel.WebUrl); // pass a string
Defensive patterns
Strategy: type-guard
Validate before calling
switch (url)
{
case string s: Commands.NavigateUrl(s); break;
case Link l: Commands.NavigateUrl(l.Url); break;
case Uri u: Commands.NavigateUrl(u.OriginalString); break;
default: logger.Warn($"Unsupported url type: {url?.GetType()}"); break;
} Type guard
static bool IsSupportedUrl(object url) => url is string || url is Link || url is Uri;
Try / catch
try { Commands.NavigateUrl(url); }
catch (Exception e) when (e.Message.Contains("Unsupported URL format"))
{ logger.Warn(e, $"Bad url type: {url?.GetType()}"); } Prevention
- Pass only string, Link, or Uri to the url dispatcher.
- Narrow command-parameter types at the binding source.
- Extract .Url from models before forwarding to NavigateUrl.
When it happens
Trigger: Calling the NavigateUrl(object url) overload with a value whose runtime type is not string, Link, or Uri — e.g. a raw Guid, int, custom model object, or null.
Common situations: A command binding passes a model object or id instead of its Url property; a generic command handler forwards arbitrary objects; null passed where a typed value was expected.
Related errors
- No URL was given.
- Cannot add file to database, file not found.
- Not supported in Desktop mode.
- Cannot open plugin settings in Fullscreen mode.
- Not supported in Fullscreen mode.
AI-assisted analysis of JosefNemec/Playnite@5911f4e964 (2026-08-13).
Data as JSON: /api/errors/396279d9cbfad397.
Report an issue: GitHub.