Logo Search packages:      
Sourcecode: f-spot version File versions  Download package

FlickrException.cs

using System;

namespace FlickrNet
{
      /// <summary>
      /// A FlickrException, thrown when a connection to Flickr fails.
      /// </summary>
00008       public class FlickrException : ApplicationException
      {
            private int code;
            private string msg = "";

            /// <summary>
            /// Get the code of the Flickr error.
            /// </summary>
            public int Code
00017             {
                  get { return code; }
            }

            /// <summary>
            /// Gets the verbose message returned by Flickr.
            /// </summary>
            public string Verbose
00025             {
                  get { return msg; }
            }
            
            /// <summary>
            /// Creates a new exception with the given the code and verbose message string
            /// </summary>
            /// <param name="code">The code of the error. 100 is Invalid Api Key and 99 is User not logged in. Others are method specific.</param>
            /// <param name="verbose">The verbose description of the error.</param>
00034             public FlickrException(int code, string verbose)
            {
                  this.code = code;
                  msg = verbose;
            }

            /// <summary>
            /// Creates a new exception from the <see cref="ResponseError"/> class.
            /// </summary>
            /// <param name="error">An instance of the <see cref="ResponseError"/> class.</param>
00044             public FlickrException(ResponseError error)
            {
                  code = error.Code;
                  msg = error.Message;
            }

            /// <summary>
            /// Overrides the message to return custom error message.
            /// </summary>
            public override string Message
00054             {
                  get
                  {
                        return msg + " (" + code + ")";
                  }
            }


      }
}

Generated by  Doxygen 1.6.0   Back to index