mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-03 08:10:28 +00:00
check err on attachment
This commit is contained in:
parent
b8cee37fdc
commit
f432330e50
1 changed files with 5 additions and 1 deletions
|
@ -128,7 +128,11 @@ func (svc *ItemService) AddAttachment(ctx context.Context, gid, itemId uuid.UUID
|
|||
}
|
||||
|
||||
// Read the contents and write them to a file on the file system
|
||||
os.MkdirAll(filepath.Dir(doc.Path), os.ModePerm)
|
||||
err = os.MkdirAll(filepath.Dir(doc.Path), os.ModePerm)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
f, err := os.Create(doc.Path)
|
||||
if err != nil {
|
||||
log.Err(err).Msg("failed to create file")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue