From 8db4d17d996fb406159ef4501c86120f68a70346 Mon Sep 17 00:00:00 2001 From: Mateusz Buda Date: Wed, 9 Mar 2016 14:10:49 +0100 Subject: [PATCH] Fix for unhandled NSFileHandleOperationException: No space left on device --- src/DOUAudioFileProvider.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/DOUAudioFileProvider.m b/src/DOUAudioFileProvider.m index 097a9b5..960df94 100644 --- a/src/DOUAudioFileProvider.m +++ b/src/DOUAudioFileProvider.m @@ -293,7 +293,13 @@ - (void)_requestDidReceiveResponse ofItemAtPath:_cachedPath error:NULL]; #endif /* TARGET_OS_IPHONE */ - [[NSFileHandle fileHandleForWritingAtPath:_cachedPath] truncateFileAtOffset:_expectedLength]; + @try { + [[NSFileHandle fileHandleForWritingAtPath:_cachedPath] truncateFileAtOffset:_expectedLength]; + } + @catch (NSException *exception) { + _failed = YES; + NSLog(@"%@", exception.debugDescription); + } _mimeType = [[_request responseHeaders] objectForKey:@"Content-Type"];