This method is to support product API.
Change-Id: I6d52b610fb1fb154ebad38acfcd5c701771baa33
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
+
+ /// <summary>
+ /// This method supports the product infrastructure and is not intended to be used directly from application code.
+ /// </summary>
+ protected static Exception GetException(int errorCode, string message) =>
+ ((PlayerErrorCode) errorCode).GetException(message);
+ throw err.GetException(message);
+ }
+
+ internal static Exception GetException(this PlayerErrorCode err, string message)
+ {
+ if (err == PlayerErrorCode.None)
+ {
+ return null;
+ }
+
string msg = $"{ (message ?? "Operation failed") } : { err.ToString() }.";
switch (err)
string msg = $"{ (message ?? "Operation failed") } : { err.ToString() }.";
switch (err)
case PlayerErrorCode.DrmNoLicense:
case PlayerErrorCode.DrmFutureUse:
case PlayerErrorCode.DrmNotPermitted:
case PlayerErrorCode.DrmNoLicense:
case PlayerErrorCode.DrmFutureUse:
case PlayerErrorCode.DrmNotPermitted:
- // TODO consider another exception.
+ // TODO consider another exception.
case PlayerErrorCode.InvalidOperation:
case PlayerErrorCode.InvalidState:
case PlayerErrorCode.SeekFailed:
case PlayerErrorCode.InvalidOperation:
case PlayerErrorCode.InvalidState:
case PlayerErrorCode.SeekFailed:
- throw new Exception(msg);
+ throw new InvalidOperationException(msg);