Skip to content

Commit

Permalink
Return errors getting extensions when formatting text,
Browse files Browse the repository at this point in the history
rather than writing the error to stderr.
  • Loading branch information
dsymonds committed Jun 15, 2015
1 parent 43447c3 commit aece6fb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions proto/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import (
"io"
"log"
"math"
"os"
"reflect"
"sort"
"strings"
Expand Down Expand Up @@ -669,10 +668,7 @@ func writeExtensions(w *textWriter, pv reflect.Value) error {

pb, err := GetExtension(ep, desc)
if err != nil {
if _, err := fmt.Fprintln(os.Stderr, "proto: failed getting extension: ", err); err != nil {
return err
}
continue
return fmt.Errorf("failed getting extension: %v", err)
}

// Repeated extensions will appear as a slice.
Expand Down

0 comments on commit aece6fb

Please sign in to comment.