syncthing/lib/ignore
Jakob Borg 946170f3fc
gui, lib/ignore: Handle editing ignores with error (fixes #5425) (#6757)
This changes the error handling in loading ignores slightly:

- There is a new ParseError type that is returned as the error
  (somewhere in the chain) when the problem was not an I/O error loading
  the file, but some issue with the contents.

- If the file was read successfully but not parsed successfully we still
  return the lines read (in addition to nil patterns and a ParseError).

- In the API, if the error IsParseError then we return a successful
  HTTP response with the lines and the actual error included in the JSON
  object.

- In the GUI, as long as the HTTP call to load the ignores was
  successful we can edit the ignores. If there was an error we show this
  as a validation error on the dialog.

Also some cleanup on the Javascript side as it for some reason used
jQuery instead of Angular for this editor...
2020-06-18 11:04:00 +02:00
..
testdata mv internal lib 2015-08-09 09:35:26 +02:00
cache.go lib/ignore, lib/model: Use an interface to detect file changes, improving tests 2017-06-11 10:27:12 +00:00
cache_test.go lib/ignore, lib/model: Use an interface to detect file changes, improving tests 2017-06-11 10:27:12 +00:00
ignore.go gui, lib/ignore: Handle editing ignores with error (fixes #5425) (#6757) 2020-06-18 11:04:00 +02:00
ignore_test.go gui, lib/ignore: Handle editing ignores with error (fixes #5425) (#6757) 2020-06-18 11:04:00 +02:00