示例#1
0
 /// <summary>
 /// Throws an exception if certain conditions are met.
 /// </summary>
 /// <param name="objError"></param>
 /// <param name="serializer"></param>
 private static void ThrowIfNestedError(object objError, JavaScriptSerializer serializer)
 {
     if (objError != null)
     {
         BrightcoveError error = serializer.ConvertToType <BrightcoveError>(objError);
         throw new BrightcoveApiException(error);
     }
 }
示例#2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="error">An encountered <see cref="BrightcoveError"/>.</param>
 public BrightcoveApiException(BrightcoveError error)
 {
     _error   = error;
     _message = String.Format("An error was returned by the server while accessing the API: {0} - {1} (code {2})",
                              error.Name, error.Message, error.Code);
 }