Prevent pushing data to server if no url is given #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also:
Prevent writing to file if no file path is given
Added a trace of the location where the dump file is saved on disk
We could talk about the design decision of implicitly using an url even if none is given (default value of
http://localhost:8080/result
). I prefer using default values resulting in the less possible implicit code. But this is by design, and it's a detail, to be honest. I followed the same design for the file path on disk (default being./
).It prevents
doErrorStuff()
from writing to disk or sending data to server, depending on the values.Also, being on mac, I couldn't find the log files, even though there was no error logged that could explain why the file creation aborted or failed. I added a trace with the full path. On mac it goes right into the application bundle.
APPNAME.app/Contents/Resources/log/errors/
(or something else after Resources if you set a custom path).