mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
More logging around markdown stash failures
This commit is contained in:
parent
025dcee3da
commit
35f1ed21c3
1 changed files with 6 additions and 3 deletions
9
ui/ui.go
9
ui/ui.go
|
@ -655,7 +655,7 @@ func stashDocument(cc *charm.Client, md markdown) tea.Cmd {
|
|||
}
|
||||
|
||||
// Is the document missing a body? If so, it likely means it needs to
|
||||
// be loaded. But...if it turnsout the document body really is empty
|
||||
// be loaded. But...if it turns out the document body really is empty
|
||||
// then we'll stash it anyway.
|
||||
if len(md.Body) == 0 {
|
||||
switch md.docType {
|
||||
|
@ -673,6 +673,9 @@ func stashDocument(cc *charm.Client, md markdown) tea.Cmd {
|
|||
case NewsDoc:
|
||||
newMD, err := fetchMarkdown(cc, md.ID, md.docType)
|
||||
if err != nil {
|
||||
if debug {
|
||||
log.Println(err)
|
||||
}
|
||||
return stashFailMsg{err, md}
|
||||
}
|
||||
md.Body = newMD.Body
|
||||
|
@ -686,8 +689,6 @@ func stashDocument(cc *charm.Client, md markdown) tea.Cmd {
|
|||
}
|
||||
}
|
||||
|
||||
md.convertToStashed()
|
||||
|
||||
newMd, err := cc.StashMarkdown(md.Note, md.Body)
|
||||
if err != nil {
|
||||
if debug {
|
||||
|
@ -696,6 +697,8 @@ func stashDocument(cc *charm.Client, md markdown) tea.Cmd {
|
|||
return stashFailMsg{err, md}
|
||||
}
|
||||
|
||||
md.convertToStashed()
|
||||
|
||||
// The server sends the whole stashed document back, but we really just
|
||||
// need to know the ID so we can operate on this newly stashed
|
||||
// markdown.
|
||||
|
|
Loading…
Reference in a new issue