Skip to content
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

Silently fails to save recording if recordingPath contains nonexistent parent directories #93

Open
Kastet opened this issue Jan 14, 2019 · 1 comment

Comments

@Kastet
Copy link
Contributor

Kastet commented Jan 14, 2019

Hi,

Thanks for your effort, the library is really easy to use and is a great help!

Currently,

let recordingPath = "\(nonexistentParentDirectory)/\(testName).json"
let recordingMode = RecordingMode.missingVinyl(recordingPath: recordingPath)

will result in Vinyl's Recorder silently failing to save newly recorded vinyl.

Suggest adding an error case into TurntableError for throwing there instead of silent return.

Happy to send a PR.

@dmcrodrigues
Copy link
Member

Hi @Kastet, thanks for flagging this ✨

I agree this failure should not be silently ignored but I'm also wondering if we should create any intermediate directories implicitly to make it easier for consumers.

In any case this call can always fail, e.g. lack of permissions, so we should throw an error, if you want to submit a PR that would be great ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants