firstsun-dev_git-files-sync/src/services
ClaudiaFang a86721752a fix: surface a clear error when requestUrl() itself rejects with HTML content
parseJson() already handles the case where a response resolves normally
but its .json getter throws on an HTML body (e.g. a login/SSO redirect
or proxy error page). But some Obsidian versions eagerly parse the
response body as JSON inside requestUrl() itself, so the same failure
can instead reject the whole call with a raw SyntaxError — landing in
safeRequest's outer catch, before there's even a response object to
inspect. That catch just rethrew the error verbatim, surfacing the
literal "Unexpected token '<', \"<!DOCTYPE \"... is not valid JSON"
message to the user (as seen in the reported "Failed to refresh" case,
against a self-hosted GitLab instance).

safeRequest's outer catch now recognizes this error's known V8
phrasings and throws the same friendly "received an HTML page" message
parseJson() already produces for the other code path.

Closes #31
2026-07-13 13:46:38 +00:00
..
git-service-base.ts fix: surface a clear error when requestUrl() itself rejects with HTML content 2026-07-13 13:46:38 +00:00
git-service-interface.ts fix(sync): clearer branch-not-found errors and connection test 2026-07-05 04:57:47 +00:00
gitea-service.ts fix(sync): clearer branch-not-found errors and connection test 2026-07-05 04:57:47 +00:00
github-service.ts fix(sync): clearer branch-not-found errors and connection test 2026-07-05 04:57:47 +00:00
gitlab-service.ts fix(sync): clearer branch-not-found errors and connection test 2026-07-05 04:57:47 +00:00