change error handling
This commit is contained in:
@@ -2,9 +2,7 @@ package output
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/bluesky-social/indigo/api/atproto"
|
||||
@@ -60,9 +58,9 @@ func (bo *blueskyoutput) Write(str string) error {
|
||||
}
|
||||
_, recerr := atproto.RepoCreateRecord(context.TODO(), cli, Recordinput)
|
||||
|
||||
if recerr != nil {
|
||||
fmt.Fprint(os.Stderr, "bsky err: ")
|
||||
fmt.Fprintln(os.Stderr, recerr)
|
||||
}
|
||||
return recerr
|
||||
}
|
||||
|
||||
func (bo *blueskyoutput) GetName() string {
|
||||
return "bluesky"
|
||||
}
|
||||
|
||||
@@ -2,4 +2,5 @@ package output
|
||||
|
||||
type OutputInterface interface {
|
||||
Write(string) error
|
||||
GetName() string
|
||||
}
|
||||
|
||||
@@ -47,9 +47,9 @@ func (to *twitteroutput) Write(str string) error {
|
||||
}
|
||||
|
||||
_, err := managetweet.Create(context.Background(), to.client, p)
|
||||
if err != nil {
|
||||
fmt.Fprint(os.Stderr, "twitter err: ")
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (to *twitteroutput) GetName() string {
|
||||
return "twitter"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user