google / go-tika

Go package for using Apache Tika
Apache License 2.0
224 stars 41 forks source link

Return an error if the JAR file doesn't exist #28

Open andymanning opened 3 years ago

andymanning commented 3 years ago

As a developer creating a tika service using a pre-downloaded JAR file I want to know if the jar file cannot be found So that I can report an error

eg. server, err := tika.NewServer("./lib/tika-server.jar", "1080")

if tika-server.jar is not found in ./lib then an error should be returned.

The error handling in the Start function doesn't return the error when running in background context

func (s *Server) Start(ctx context.Context) error { if _, err := os.Stat(s.jar); os.IsNotExist(err) { return err }

Please assign this issue to me, I'll fix.

tbpg commented 3 years ago

Go for it. Thank you!