mirror of
https://github.com/schollz/croc.git
synced 2024-11-23 23:54:17 +03:00
add error handling
This commit is contained in:
parent
bc9dbfd905
commit
90ed1f797e
@ -1737,6 +1737,9 @@ func (c *Client) createEmptyFileAndFinish(fileInfo FileInfo, i int) (err error)
|
|||||||
description = " " + description
|
description = " " + description
|
||||||
}
|
}
|
||||||
width, _, err := term.GetSize(int(os.Stdout.Fd()))
|
width, _, err := term.GetSize(int(os.Stdout.Fd()))
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
if len(description) > width {
|
if len(description) > width {
|
||||||
description = description[:(width-3)] + "..."
|
description = description[:(width-3)] + "..."
|
||||||
}
|
}
|
||||||
@ -1916,7 +1919,10 @@ func (c *Client) setBar() {
|
|||||||
} else if !c.Options.IsSender {
|
} else if !c.Options.IsSender {
|
||||||
description = " " + description
|
description = " " + description
|
||||||
}
|
}
|
||||||
width, _, _ := term.GetSize(int(os.Stdout.Fd()))
|
width, _, err := term.GetSize(int(os.Stdout.Fd()))
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
description = strings.TrimSpace(description)
|
description = strings.TrimSpace(description)
|
||||||
if len(description) > width {
|
if len(description) > width {
|
||||||
description = description[:(width-3)] + "..."
|
description = description[:(width-3)] + "..."
|
||||||
|
Loading…
Reference in New Issue
Block a user