Repository navigation
Conversation
By not using a colon, the error doesn't get prematurely cut off in the GUI.
| } | ||
| if err := checkAvailableSpace(req, f.MinDiskFree, usage); err != nil { | ||
| return fmt.Errorf("insufficient space in folder %v (%v): %w", f.Description(), fs.URI(), err) | ||
| return fmt.Errorf("insufficient space in folder %v (%v) - %w", f.Description(), fs.URI(), err) |
There was a problem hiding this comment.
Feels wrong to change a (common) pattern in error formatting to work around a UI issue - couldn't we teach the UI to not hide stuff after/before a colon (or whatever it does)?
There was a problem hiding this comment.
Of course, but we do that for a reason, as the full error is often quite long and hides the most important part at the end.
There was a problem hiding this comment.
sed s#:#<br/>#g in the ui?
There was a problem hiding this comment.
Then the 5+ times wrapped error will create ugly, super high table cells.
Yeah forgot about that - not a particularly good solution to that problem (too long errors), but I am pretty inclined to go ¯_ (ツ)_/¯ - this does solve this particular issue with minimal effort. And I don't have any other suggestions besides a custom error type that has a long and short-form, and that's definitely not minimal effort (nor elegant).
Also closes syncthing#8992.
By not using a colon, the error doesn't get prematurely cut off in the GUI.