-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added check for tika jar file, updated accompanying test #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
s.jar = "nonexistentFile.jar" | ||
if err := s.Start(ctx); err == nil { | ||
t.Fatalf("s.Start got no error, want error for missing Jar file") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this to TestStartError
(which may need to be updated to point to real files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in TestStartError
. I am unsure of what your are asking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. You're totally right, my bad.
tika/server.go
Outdated
if _, err := os.Stat(s.jar); os.IsNotExist(err) { | ||
return err | ||
} | ||
cmd := command("java", append([]string{"-jar", s.jar, "-p", s.port}, s.child.args()...)...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woops. Repushed.
if _, err := os.Stat(s.jar); os.IsNotExist(err) { | ||
return err | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do this in NewServer
? Could see doing it in either function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, could be in either. Pathing of where things are called from could come into play, which is why I put it here and not in NewServer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
Added an additional line by accident. Removed it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Per this issue: #17
Fixes the silent missing jar file error. Added accompanying test.