Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-iOS
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
270
Issues
270
List
Boards
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
VLC-iOS
Commits
1b1116c9
Commit
1b1116c9
authored
Jun 16, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VLCHTTPFileDownloader: improve error reporting
parent
a702fdf0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
AspenProject/VLCHTTPFileDownloader.h
AspenProject/VLCHTTPFileDownloader.h
+1
-1
AspenProject/VLCHTTPFileDownloader.m
AspenProject/VLCHTTPFileDownloader.m
+12
-4
No files found.
AspenProject/VLCHTTPFileDownloader.h
View file @
1b1116c9
...
...
@@ -14,7 +14,7 @@
-
(
void
)
downloadEnded
;
@optional
-
(
void
)
downloadFailedWithError
:(
NSError
*
)
error
;
-
(
void
)
downloadFailedWithError
Description
:(
NSString
*
)
description
;
-
(
void
)
progressUpdatedTo
:(
CGFloat
)
percentage
;
@end
...
...
AspenProject/VLCHTTPFileDownloader.m
View file @
1b1116c9
...
...
@@ -55,6 +55,10 @@
_expectedDownloadSize
=
[
response
expectedContentLength
];
[
self
.
delegate
downloadStarted
];
APLog
(
@"expected download size: %i"
,
_expectedDownloadSize
);
}
else
{
APLog
(
@"unhandled status code %i"
,
statusCode
);
if
([
self
.
delegate
respondsToSelector
:
@selector
(
downloadFailedWithErrorDescription
:)])
[
self
.
delegate
downloadFailedWithErrorDescription
:[
NSString
stringWithFormat
:
@"Download failed with HTTP code %i"
,
statusCode
]];
}
}
...
...
@@ -68,8 +72,8 @@
if
(
!
fileHandle
)
{
APLog
(
@"file creation failed, no data was saved"
);
if
([
self
.
delegate
respondsToSelector
:
@selector
(
downloadFailedWithError
:)])
[
self
.
delegate
downloadFailedWithError
:
nil
];
if
([
self
.
delegate
respondsToSelector
:
@selector
(
downloadFailedWithError
Description
:)])
[
self
.
delegate
downloadFailedWithError
Description
:
@"File creation failed"
];
return
;
}
}
...
...
@@ -105,8 +109,8 @@
_downloadInProgress
=
NO
;
[
UIApplication
sharedApplication
].
networkActivityIndicatorVisible
=
NO
;
if
([
self
.
delegate
respondsToSelector
:
@selector
(
downloadFailedWithError
:)])
[
self
.
delegate
downloadFailedWithError
:
error
];
if
([
self
.
delegate
respondsToSelector
:
@selector
(
downloadFailedWithError
Description
:)])
[
self
.
delegate
downloadFailedWithError
Description
:
error
.
description
];
[
self
.
delegate
downloadEnded
];
}
...
...
@@ -114,6 +118,10 @@
-
(
void
)
cancelDownload
{
[
_urlConnection
cancel
];
if
([
self
.
delegate
respondsToSelector
:
@selector
(
downloadFailedWithErrorDescription
:)])
[
self
.
delegate
downloadFailedWithErrorDescription
:
@"Download canceled by user"
];
[
self
.
delegate
downloadEnded
];
}
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment