Velhotes/Vinyl

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

Kastet opened this issue · 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.

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