Skip to content

lib/config, lib/model: Better error message for insufficient space - #8992

Closed
calmh wants to merge 1 commit into
syncthing:mainfrom
calmh:insufficientspace
Closed

calmh wants to merge 1 commit into
syncthing:mainfrom
calmh:insufficientspace

Conversation

@calmh

@calmh calmh commented Jul 19, 2023

Copy link
Copy Markdown
Member

By not using a colon, the error doesn't get prematurely cut off in the GUI.

Screenshot 2023-07-19 at 22 23 00

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)

@imsodin imsodin Jul 24, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sed s#:#<br/>#g in the ui?

@imsodin imsodin Jul 26, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

calmh added a commit to calmh/syncthing that referenced this pull request Jul 26, 2023

@imsodin imsodin left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh never mind, there's #9005

Getting rid of a crutch instead of working around it is also an option of course :)

@calmh calmh closed this in #9005 Jul 26, 2023
calmh added a commit that referenced this pull request Jul 26, 2023
@calmh
calmh deleted the insufficientspace branch July 27, 2023 05:45
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jul 26, 2024
@syncthing syncthing locked and limited conversation to collaborators Jul 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants