internal static Exception CreateException(string message, Exception innerException, ErrorMessage errorMessage) { if (null != errorMessage) { return new LastFmException(message, innerException, errorMessage); } return new Exception(Constants.ReceivedBadRequestMsg, innerException); }
internal static Exception CreateException(string message, ErrorMessage errorMessage) { if (null != errorMessage) { message = message.Trim(); return new LastFmException(string.IsNullOrWhiteSpace(message) ? Constants.ReceivedBadRequestMsg : message, null, errorMessage); } return new Exception(Constants.ReceivedBadRequestMsg); }
internal static Exception CreateException(ErrorMessage errorMessage) { return CreateException(Constants.ReceivedBadRequestMsg, errorMessage); }
internal LastFmException(string message, Exception innerException, ErrorMessage errorMessage) : this(message, innerException as WebException) { LastFmError = errorMessage; }
/// <summary> /// Create new instance of LastFmException /// </summary> /// <param name="message">Message of Exception</param> /// <param name="innerException">Inner Exception</param> public LastFmException(string message, WebException innerException) : base(message, innerException) { LastFmError = GetBaseResponse(innerException); HelpLink = "http://www.last.fm/api/errorcodes"; }