diff --git a/client/helpers/backgroundHelper.go b/client/helpers/backgroundHelper.go index 3122bfa..67864c6 100644 --- a/client/helpers/backgroundHelper.go +++ b/client/helpers/backgroundHelper.go @@ -2,7 +2,6 @@ package helpers import ( "errors" - "log" "os" "path/filepath" "strconv" @@ -159,7 +158,7 @@ func ReadMessage(messageFilename string) ([]string, []string, string, error) { if _, err := os.Stat(filepath.Join(client.GetConfig().StoragePath, identity.Uuid, "files")); os.IsNotExist(err) { err = os.MkdirAll(filepath.Join(client.GetConfig().StoragePath, identity.Uuid, "files"), 0700) if err != nil { - log.Fatal(err) + return nil, nil, "ReadMessage: MkdirAll", err } } for _, file := range usermsg.Files { diff --git a/contactcard.go b/contactcard.go index 2c76a61..969ded8 100644 --- a/contactcard.go +++ b/contactcard.go @@ -8,7 +8,6 @@ import ( "image/color" "image/png" "io" - "log" "math" "os" @@ -101,7 +100,7 @@ func (contact *ContactCard) WriteCompressed(filename string) error { return nil } -func (contact *ContactCard) WritePng(filename string) { +func (contact *ContactCard) WritePng(filename string) error { out, err := proto.Marshal(contact) if err != nil { println(err) @@ -128,18 +127,18 @@ func (contact *ContactCard) WritePng(filename string) { f, err := os.Create(filename) if err != nil { - log.Fatal(err) + return err } if err := png.Encode(f, img); err != nil { f.Close() - log.Fatal(err) + return err } if err := f.Close(); err != nil { - log.Fatal(err) + return err } - + return nil } func (Contact *ContactCard) WriteQr(filename string) error {