Vinyl icon indicating copy to clipboard operation
Vinyl copied to clipboard

Silently fails to save recording if `recordingPath` contains nonexistent parent directories

Open Kastet opened this issue 6 years ago • 1 comments

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.

Kastet avatar Jan 14 '19 03:01 Kastet

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 ❤️

dmcrodrigues avatar Jan 14 '19 10:01 dmcrodrigues