mirror of
https://github.com/firstsun-dev/git-files-sync.git
synced 2026-07-22 17:20:30 +00:00
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 |
||
|---|---|---|
| .. | ||
| git-service-base.ts | ||
| git-service-interface.ts | ||
| gitea-service.ts | ||
| github-service.ts | ||
| gitlab-service.ts | ||