denolehov / obsidian-git

Backup your Obsidian.md vault with git
MIT License
6.15k stars 252 forks source link

[Enhancement]: Graceful offline support #590

Open bardbess opened 10 months ago

bardbess commented 10 months ago

Describe the bug

Fristly, thanks for this great plugin!

When disconnected from the internet and Obsidian git still attempts to pull changes it throws some panicky error messages. I'm wondering if this could be wrapped up into a simple 'No Github.com Connection' message.

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

Error: Request Failed - Unknown Host Exception
Unable to resolve github.com: No address associated with hostname.

Steps to reproduce

  1. Set Obsidian Git to either

    • pull on startup
    • push/pull every X period
  2. Disconnect from the internet

  3. Start Obsidian

Expected Behavior

A simple user friendly error message, eg:

No Github.com Connection

Addition context

No response

Operating system

Android

Installation Method

None

Plugin version

2.20.7