Commit 625c46e9 by Emanuele Tidó Committed by GitHub

throw InvalidResponseCodeException instead of HttpDataSourceException

if responseCode and responseMessage ara available always throws an InvalidResponseCodeException instead of HttpDataSourceException, so in onPlayerError method the http status code and message can be used to decide what will be the next step.
parent 1347d572
...@@ -377,8 +377,8 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou ...@@ -377,8 +377,8 @@ public class DefaultHttpDataSource extends BaseDataSource implements HttpDataSou
errorResponseBody = errorResponseBody =
errorStream != null ? Util.toByteArray(errorStream) : Util.EMPTY_BYTE_ARRAY; errorStream != null ? Util.toByteArray(errorStream) : Util.EMPTY_BYTE_ARRAY;
} catch (IOException e) { } catch (IOException e) {
throw new HttpDataSourceException( throw new InvalidResponseCodeException(
"Error reading non-2xx response body", e, dataSpec, HttpDataSourceException.TYPE_OPEN); responseCode, responseMessage, headers, dataSpec, null);
} }
closeConnectionQuietly(); closeConnectionQuietly();
InvalidResponseCodeException exception = InvalidResponseCodeException exception =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment