Skip to content

Commit

Permalink
err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
negator committed Jul 28, 2023
1 parent ac4fd1a commit b0ba350
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vips/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func NewTargetToWriter(writer io.Writer) (*Target, error) {
vipsTarget := C.create_go_custom_target(targetPtr)

if vipsTarget == nil {
return nil, fmt.Errorf("error creating target from source: nil source")
return nil, handleVipsError()
}

target.writer = writer
Expand All @@ -157,7 +157,7 @@ func NewSourceFromReader(reader io.Reader) (*Source, error) {
vipsSrc := C.create_go_custom_source(sourcePtr)

if vipsSrc == nil {
return nil, fmt.Errorf("error creating source from reader: nil source")
return nil, handleVipsError()
}

source.reader = reader
Expand All @@ -178,7 +178,7 @@ func NewSourceFromFile(path string) (*Source, error) {
vipsSrc := C.vips_source_new_from_file(cpath)

if vipsSrc == nil {
return nil, fmt.Errorf("error creating source from reader: nil source")
return nil, handleVipsError()
}

source.vipsSrc = vipsSrc
Expand Down

0 comments on commit b0ba350

Please sign in to comment.